10 JavaScript ideas you must understand for interviews
In an effort to get employment, many of people are studying web programming and JavaScript. Self-learning
frequently results in gaps in one's knowledge of the JavaScript language itself.
The amount of vocabulary that is actually required to create complicated web pages is actually rather
astonishing. People who build entire websites from scratch frequently lack a solid understanding of
JavaScript's
principles.
The issue is that many tech employers' interview questions specifically assess your comprehension of JS. When
a
candidate only understands enough to get by but lacks a thorough command of the language, it is immediately
apparent.
The ideas listed below are ones that are regularly broached in web development interviews. This assumes that
you
are already familiar with fundamental concepts like loops, functions, and callbacks.
Concepts
- Value vs. Reference - Recognize the copying and passing of functions, objects, arrays, and functions.
Recognize that what is being copied is the reference. Recognize that passing and copying primitives
involves
copying the value.
-
Scope - Recognize the variations between global, function, and block scope. Recognize where the
available
variables are. Know how a variable lookup is carried out by the JavaScript engine.ƒ
- Hoisting - Recognize that declarations of variables and functions are raised to the top of their scope.
Be
aware that function expressions cannot be hoisted.
- Closures - Recognize that a function keeps access to the scope in which it was first defined. Learn what
this enables, including data masking, memoization, and the creation of dynamic functions.
- this - Understand the terms of this contract. Understand how it operates, how to determine what it will
be
equal to in a function, and why it is helpful.
- new - Understand its connection to object-oriented programming. Understand what occurs when a function
is
called with new. Recognize how the prototype attribute of the function is what the object created by new
derives from.
- apply, call, bind - Understand how each of these functions operates. Understand how to use them.
Understand
what they do with this.
- Prototypes & Inheritance - Recognize how the [[Prototype]] chain affects inheritance in JavaScript.
Recognize how to implement inheritance using new and how to set up inheritance using objects and
functions.
Understand what the prototype and __proto__ properties are and how they work.
- Asynchronous JS - Recognize the event loop. Recognize how the browser responds to input from the user,
web
requests, and events in general. Understand asynchronous code and how to implement it properly.
Recognize
the asynchronous and single-threaded natures of JavaScript.
- Higher Order Functions - Recognize the significance of functions being first-class objects in
JavaScript.
Recognize that it is OK to return a function from another function. Recognize the strategies that
closures
and higher order functions enable.
All the best for your interviews.