JavaScript, Crack the Interview

Equality Operators

'1'  ==  1         // true
1 == '1' // true
0 == false // true
0 == null // false
3 === 3   // true
3 === '3' // false

undefined

  • accessing the global variable undefined
  • accessing a declared but not yet initialized variable
  • calling functions without a return statement
  • return with nothing to return
  • non-existent object properties
  • function parameters without any explicit value
var name; 
console.log(name);
var name; 
console.log(typeof (name));

NULL

console.log(null);
console.log(typeof (null));

Hoisting

a = 5;
console.log(a); // Error
b = 5;
console.log(b); // 5
var b;

Object Oriented Programming

  1. Encapsulation
  2. Polymorphism
  3. Inheritance

Call Stack

function firstFunction(){
throw new Error('Stack Trace Error');
}
function secondFunction(){
firstFunction();
}
function thirdFunction(){
secondFunction();
}
thirdFunction();
//Stack Trace Error! But it also represents the corresponding call //stack
// at firstFunction (<anonymous>:2:11)
// at secondFunction (<anonymous>:5:5)
// at thirdFunction (<anonymous>:8:5)
// at <anonymous>:10:1

Higher-Order Functions

const numbers = [1,2,3,4,5];
const total = numbers.reduce((a,b)=>a+b,0);
console.log(total) // 15

JavaScript Scope

  • Local scope
  • Global scope

Closure

--

--

--

I am Sakib Uddin from Bangladesh. I am a front End Developer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Building a secure single-page application (SPA) with React.js

Build an Instagram Feed UI Clone with React, Next.js and Tailwind CSS

[Unity ECS] The cost of [Inject] / ComponentGroup before each OnUpdate

Building Advertising Websites : The View

Create a RingCentral web app that works in IE 11

Copy Slides from One Presentation to Another Using Java

Server-Side Rendering versus Client-Side Rendering

Singly linked list in javascript

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sakibuddin

Sakibuddin

I am Sakib Uddin from Bangladesh. I am a front End Developer

More from Medium

JavaScript forEach or map — what’s the difference?

Understanding prototype chaining in Javascript

Five ways to flatten an array in Javascript

Behaviour of ‘This’ Keyword in Regular and Arrow Functions in Javascript.