Toptal is a marketplace for top JavaScript developers, engineers, programmers, coders, architects, and consultants. Top companies and start-ups choose Toptal JavaScript freelancers for their mission critical software projects.

Hire JavaScript developers and engineers

Charles has a Ph.D. in aerospace engineering and spent three years developing custom data processing and analysis programs for NASA. He specializes in scalable, enterprise-level application development and engineering solutions for exceptionally high throughputs. He is also the founder and owner of GreatVocab.com, for which he developed the core system using novel concepts in data analysis and control theory. Click to continue

Zoran is a software engineer with over ten years of professional experience with a wide range of technologies. He has worked with C/C++, Python, Go, JavaScript, Java, and more. Currently focusing on full-stack, scalable applications development, he has been a part of teams of all sizes in environments ranging from small private companies to Google. Click to continue

Tomislav is a software engineer, technical consultant, and architect with over 10 years of experience. He specializes in full-stack, highly scalable, real-time JavaScript and Node.js applications, with past experience in C#, Java, and Ruby. He is an agile Kanban practitioner who loves to collaborate on development projects. Click to continue

Rafael is passionate about change and trying new things, both professionally and in general with his life. He is a skilled web developer with over 8 years of experience. He loves startups and is extremely proactive. Click to continue

Ignacio is a software engineer and architect with more than eight years of experience in many programming languages, libraries, and frameworks. He enjoys working in freelance mode to give him the opportunity to constantly develop new skills, and he is familiar with many different paradigms and technologies. Click to continue

Rafal is a skilled software engineer with strong architecture and coding skills, broad technology knowledge, and many years of experience delivering software. He is a project leader, mentor, coder, and consultant. He specializes in business software, process automation, and transactional systems. Click to continue

Mark is an entrepreneur, engineer, CTO, and artisan with decades of startup experience, including co-founding Excite.com. He makes complex problems simple with expressive, maintainable code. He believes in building small, well-tested, functional pieces, loosely joined by a well-documented contract. Click to continue

Alejandro got his bachelor's degree in software engineering in 2005 and has since been working for software companies of all sizes from all around the globe as a freelancer. Currently, he enjoys working as a full-stack architect in JavaScript projects, where his experience and his deep understanding of architecture and theory are most impactful. Click to continue

“Toptal allows corporations to quickly assemble teams that have the right skills for specific projects.”

Steven Norton

Testimonials

“I really enjoyed my experience with Toptal. Searching for a developer was both painless and engaging, and the first match was a perfect fit! Toptal is a fantastic way to find talented developers for small or large aspects of your project.”

Willem Shepherd

Creative Director @ Mookieyams

“Toptal has been extremely helpful to us in finding top remote talent. The ratio from interview to hire with Toptal candidates is the highest I've ever experienced in my professional career.”

Philipp Berner

Co-founder and CTO @ KeepSafe

“One of their engineers from Colombia has joined our team as a full-time developer for more than 6 months, sometimes flying to work on-site in New York City with us. He is one of the best developers I've ever worked with.”

Carter Cleveland

CEO @ Artsy

“Toptal was the best thing to happen to my web app. Initially, I hired a team of freelancers from India through another freelancing website—which was a nightmare. In fact, it was so bad that I had to start again from scratch, which is when I found Toptal. The experiences were like night and day. It was so refreshing to get partnered up with a quality developer that I could trust due to Toptal's extensive screening process. I will only use Toptal from now on and highly recommend you do the same.”

Chris Holtzhauer

CEO @ HootRecruit

“With the pressure on and millions watching the Cleveland Cavaliers during the NBA Playoffs, Toptal delivered the talent and expertise needed to launch a brand new fan engagement platform.”

Conor Kenney

Director of Professional Services @ Cleveland Cavaliers

“We've had multiple needs for various development talent and Toptal doesn't disappoint. They truly focus on matching the best developer to our specific engagements, and they continue to stay connected in an effort to exceed our expectations at all times”

Mindle Hastings

Sr. Product Manager @ Bodybuilding.com

“Toptal understood our project needs immediately. We were matched with an exceptional freelancer from Argentina who, from Day 1, immersed himself in our industry, blended seamlessly with our team, understood our vision, and produced top-notch results. Toptal makes connecting with superior developers and programmers very easy.”

Jason Kulik

Co-Founder @ ProHatch

“Always incredibly responsive, prompt, and flexible, Anna has done an outstanding job -- her work is exactly what we needed. Toptal has been a great experience for us due to the ease of getting a project going with quality talent at a cost that fits our budget. The automated online system for managing everything during onboarding was also impressive.”

Cody Wilke

Product Manager @ Crucial Life Sciences Data Solutions

“Sergio was an awesome developer to work with. Top notch, responsive, and got the work done efficiently.”

Dennis Baldwin

Chief Technologist and Co-Founder @ PriceBlink

“I'm incredibly impressed with the caliber of the Toptal developers I have worked with - they have proven themselves to be both dedicated and highly talented. We will most definitely continue to work with Toptal.
”

Savannah de Savary

Founder @ Industry Hub

“Toptal has helped my business tremendously by finding, vetting, and recruiting the talent I need, at the right time. I’d definitely recommend it to others.”

Xavier Xicay

CEO & Creative Director @ Tuatara Corp

“We used Toptal to hire a developer with extensive Amazon Web Services experience. We interviewed four candidates, one of which turned out to be a great fit for our requirements. The process was quick and effective. ”

Abner Guzmán Rivera

CTO and Chief Scientist @ Photo Kharma

“The best talent is at Toptal for sure. It's way better and faster than any other means of getting top talent.”

Rajesh Nagarajan

Co-Founder & CTO @ maxmantra

“The Toptal process was very organized, personable, and professional. They get to know you and your project idea, and then quickly provide you with several of the world's best developers, who will work hard to achieve your vision. I found a great developer in only a few days and was able to turn my idea into a functional product.”

Ben Woratyla

CEO @ Book Swap

Hire a top JavaScript developer now.

Toptal is a marketplace for top JavaScript developers, engineers, programmers, coders, architects, and consultants. Top companies and start-ups choose Toptal freelancers for their mission-critical software projects.

Charles has a Ph.D. in aerospace engineering and spent three years developing custom data processing and analysis programs for NASA. He specializes in scalable, enterprise-level application development and engineering solutions for exceptionally high throughputs. He is also the founder and owner of GreatVocab.com, for which he developed the core system using novel concepts in data analysis and control theory.

Zoran is a software engineer with over ten years of professional experience with a wide range of technologies. He has worked with C/C++, Python, Go, JavaScript, Java, and more. Currently focusing on full-stack, scalable applications development, he has been a part of teams of all sizes in environments ranging from small private companies to Google.

Tomislav is a software engineer, technical consultant, and architect with over 10 years of experience. He specializes in full-stack, highly scalable, real-time JavaScript and Node.js applications, with past experience in C#, Java, and Ruby. He is an agile Kanban practitioner who loves to collaborate on development projects.

Rafael is passionate about change and trying new things, both professionally and in general with his life. He is a skilled web developer with over 8 years of experience. He loves startups and is extremely proactive.

Ignacio is a software engineer and architect with more than eight years of experience in many programming languages, libraries, and frameworks. He enjoys working in freelance mode to give him the opportunity to constantly develop new skills, and he is familiar with many different paradigms and technologies.

Rafal is a skilled software engineer with strong architecture and coding skills, broad technology knowledge, and many years of experience delivering software. He is a project leader, mentor, coder, and consultant. He specializes in business software, process automation, and transactional systems.

Mark is an entrepreneur, engineer, CTO, and artisan with decades of startup experience, including co-founding Excite.com. He makes complex problems simple with expressive, maintainable code. He believes in building small, well-tested, functional pieces, loosely joined by a well-documented contract.

Alejandro got his bachelor's degree in software engineering in 2005 and has since been working for software companies of all sizes from all around the globe as a freelancer. Currently, he enjoys working as a full-stack architect in JavaScript projects, where his experience and his deep understanding of architecture and theory are most impactful.

The Vital Guide to JavaScript Interviewing

The Challenge

In today’s technology landscape, JavaScript has essentially become synonymous with client-side web development and now, with the advent of technologies like Node.js, JavaScript is becoming a dominant server side technology as well.

Accordingly, resumes that reference at least some degree of JavaScript experience have essentially become universal in the software development community. This makes locating JavaScript developers fairly easy, but makes sifting through them to find “the elite few” that much more of a challenge. Finding them requires a highly-effective recruiting process, as described in our post In Search of the Elite Few – Finding and Hiring the Best Developers in the Industry. Such a process can then be augmented with questions – such as those presented herein – to identify those sparsely distributed candidates across the globe who are true JavaScript experts.

Yeah, I know JavaScript…

As with any technology, there’s knowing JavaScript and then there’s really knowing JavaScript. In our search for true masters of the language, we require an interview process that can accurately quantify a candidate’s position along the continuum of JavaScript expertise levels.

Toward that goal, this post offers a sampling of questions that are key to evaluating the breadth and depth of a candidate’s mastery of JavaScript. It is important to bear in mind, though, that these sample questions are intended merely as a guide. Not every “A” candidate worth hiring will be able to properly answer them all, nor does answering them all guarantee an “A” candidate. At the end of the day, hiring remains as much of an art as it does a science.

Assessing the Foundation

It's far too common to encounter 'experienced' JavaScript developers whose grasp of the fundamentals of the language is either weak or confused.

JavaScript is a prototype-based scripting language with dynamic typing. JavaScript can, at first, be a bit confusing for developers experienced in class-based languages (such as Java or C++), as it is dynamic and does not provide a traditional class implementation. It’s therefore far too common to encounter ‘experienced’ JavaScript developers whose grasp of the fundamentals of the language is either weak or confused.

Questions that can help assess a developer’s grasp of JavaScript fundamentals, including some of its more subtle nuances, are therefore an important component of the interview process. Here are some examples…

Q: Describe inheritance and the prototype chain in JavaScript. Give an example.

Although JavaScript is an object-oriented language, it is prototype-based and does not implement a traditional class-based inheritance system.

In JavaScript, each object internally references another object, called its prototype. That prototype object, in turn, has a reference to its prototype object, and so on. At the end of this prototype chain is an object with null as its prototype. The prototype chain is the mechanism by which inheritance – prototypal inheritance to be precise – is achieved in JavaScript. In particular, when a reference is made to a property that an object does not itself contain, the prototype chain is traversed until the referenced property is found (or until the end of the chain is reached, in which case the property is undefined).

This is somewhat of a trick question since, in JavaScript, objects essentially are hashtables; i.e., collections of name-value pairs. In these name-value pairs, a crucial point to be aware of is that the names (a.k.a., keys) are always strings. And that actually leads us to our next question…

It is the rare candidate who will correctly answer that this alerts the string “bar”. Most will mistakenly answer that it alerts the string “foo”. So let’s understand why “bar” is indeed the correct, albeit surprising, answer…

As mentioned in the answer to the prior question, a JavaScript object is essentially a hashtable of name-value pairs where the names (i.e., keys) are strings. And they are always strings. In fact, when an object other than a string is used as a key in JavaScript, no error occurs; rather, JavaScript silently converts it to a string and uses that value as the key instead. This can have surprising results, as the above code demonstrates.

To understand the above code snippet, one must first recognize that the map object shown does not map the object foo to the string “foo”, nor does it map the object bar to the string “bar”. Since the objects foo and bar are not strings, when they are used as keys for map, JavaScript automatically converts the key values to strings using each object’s toString() method. And since neither foo nor bar defines its own custom toString() method, they both use the same default implementation. That implementation simply generates the literal string “[object Object]” when it is invoked. With this explanation in mind, let’s re-examine the code snippet above, but this time with explanatory comments along the way:

Q: Explain closures in JavaScript. What are they? What are some of their unique features? How and why might you want to use them? Provide an example.

A closure is a function, along with all variables or functions that were in-scope at the time that the closure was created. In JavaScript, a closure is implemented as an “inner function”; i.e., a function defined within the body of another function. Here is a simplistic example:

An important feature of closures is that an inner function still has access to the outer function’s variables even after the outer function has returned. This is because, when functions in JavaScript execute, they use the scope that was in effect when they were created.

A common point of confusion that this leads to, though, is based on the fact that the inner function accesses the values of the outer function’s variables at the time it is invoked (rather than at the time that it was created). To test the candidate’s understanding of this nuance, present the following code snippet that dynamically creates five buttons and ask what will be displayed when the user clicks on the third button:

Many will mistakenly answer that “Button 3 clicked” will be displayed when the user clicks on the third button. In fact, the above code contains a bug (based on a misunderstanding of the way closures work) and “Button 6 clicked” will be displayed when the user clicks on any of the five buttons. This is because, at the point that the onclick method is invoked (for any of the buttons), the for loop has already completed and the variable i already has a value of 5.

An important follow-up question is to ask the candidate how to fix the bug in the above code, so as to produce the expected behavior (i.e., so that clicking on button n will display “Button n clicked”). The correct answer, which demonstrates proper use of closures, is as follows:

Although by no means exclusive to JavaScript, closures are a particularly useful construct for many modern day JavaScript programming paradigms. They are used extensively by some of the most popular JavaScript libraries, such as jQuery and Node.js.

Embracing Diversity

JavaScript accommodates an unusually wide array of programming techniques and design patterns. A JavaScript master will be well aware of the significance and ramifications of choosing one approach vs. another.

A multi-paradigm language, JavaScript supports object-oriented, imperative, and functional programming styles. As such, JavaScript accommodates an unusually wide array of programming techniques and design patterns. A JavaScript master will be well aware of the existence of these alternatives and, more importantly, the significance and ramifications of choosing one approach over another. Here are a couple of sample questions that can help gauge this dimension of a candidate’s expertise:

Q: Describe the different ways of creating objects and the ramifications of each. Provide examples.

The graphic below contrasts various ways in JavaScript to create objects and the differences in the prototype chains that result from each.

Q: Is there ever any practical difference between defining a function as a function expression (e.g., var foo = function(){}) or as a function statement (e.g., function foo(){})? Explain your answer.

Yes, there is a difference, based on how and when the value of the function is assigned.

When a function statement (e.g., function foo(){}) is used, the function foo may be referenced before it has been defined, through a technique known as “hoisting”. A ramification of hoisting is that the last definition of the function is the one that will be employed, regardless of when it is referenced (if that’s not clear, the example code below should help clarify things).

In contrast, when a function expression (e.g., var foo = function(){}) is used, the function foo may not be referenced before it is defined, just like any other assignment statement. Because of this, the most recent definition of the function is the one that will be employed (and accordingly, the definition must precede the reference, or the function will be undefined).

Here’s a simple example that demonstrates the practical difference between the two. Consider the following code snippet:

Many JavaScript developers will mistakenly answer that the above alert will display “1” and will be surprised to learn that it will in fact display “2”. As described above, this is due to hoisting. Since a function statement was used to define the function, the last definition of the function is the one that is hoisted at the time it is invoked (even though it is subsequent to its invocation in the code!).

In this case, the answer is more intuitive and the alert will display “1” as expected. Since a function expression was employed to define the function, the most recent definition of the function is the one that is employed at the time it is invoked.

The Devil’s in the Details

In addition to the advanced JavaScript concepts discussed thus far, there are a number of lower-level syntactical details of the language that a true JavaScript guru will be intimately familiar with. Here are a few examples…

Q: What is the significance of, and reason for, wrapping the entire content of a JavaScript source file in a function block?

This is an increasingly common practice, employed by many popular JavaScript libraries (jQuery, Node.js, etc.). This technique creates a closure around the entire contents of the file which, perhaps most importantly, creates a private namespace and thereby helps avoid potential name clashes between different JavaScript modules and libraries.

Another feature of this technique is to allow for an easily referenceable (presumably shorter) alias for a global variable. This is often used, for example, in jQuery plugins. jQuery allows you to disable the $ reference to the jQuery namespace, using jQuery.noConflict(). If this has been done, your code can still use $ employing this closure technique, as follows:

(function($) { /* jQuery plugin code referencing $ */ } )(jQuery);

Q: What is the difference between == and ===? Between != and !==? Give an example.

The difference between “triple” comparison operators (===, !==) and double comparison operators (==, !=) in JavaScript is that double comparison operators perform implicit type conversion on the operands before comparing them whereas, with the triple comparison operators, no type conversion is performed (i.e., the values must be equal and the types must be the same for the operands to be considered equal).

As a simple example, the expression 123 == '123' will evaluate to true, whereas 123 === '123' will evaluate to false.

Q: What is the significance of including 'use strict' at the beginning of a JavaScript source file?

Though there is much more to be said on the topic, the short and most important answer here is that use strict is a way to voluntarily enforce stricter parsing and error handling on your JavaScript code at runtime. Code errors that would otherwise have been ignored or would have failed silently will now generate errors or throw exceptions. In general, it is a good practice.

Wrap Up

JavaScript is perhaps one of the most misunderstood and underestimated programming languages in existence today. The more one peels the JavaScript onion, the more one realizes what is possible. Accordingly, finding true masters of the language is a challenge. We hope you find the questions presented in this post to be a useful foundation for “separating the wheat from the chaff” in your quest for the “elite few” among JavaScript developers.