Interview Cheatsheet of JavaScript | Most Common Q&A

Interview Cheatsheet of JavaScript | Most Common Q&A

'' The most popular Javascript interview questions started showing a trend as I did studies for this article. '' - Vivek Chudasama*

I hope you must know these topics basic knowledge of programming and the internet, and knowledge of JavaScript, especially ES6+ syntax, and HTML/CSS.

Variables in JS 🕹

Variables are the foundation of every programming language. They are used to store values. A variable can be a number, a string, or any combination of these. Now, JS is a typeless language. It is not necessary to specify the type of variable. Simply declare it, and JS will figure it out for you.

Blog ex.png

In JavaScript, there are three ways to declare variables: var, let, and const. Blog ex 2.png

Data types in JS 🕹

Primitive data types are a set of basic data types in javascript. null, number, string, symbol, and un-define Boolean and Bigint. An object is a non-primitive data type in JavaScript and also function is a part of the structure data type. These are the seven primitive data types in JavaScript.

Blog ex 3.png

Expression in JS 🕹

A valid collection of regular expressions, variables, operators, and statements that produces a single value is known as an expression in JavaScript. This single value can be a number, a string, or a logical value, depending on the expression.

"A chunk of code that produces a value is called an expression every value returns directly is an expression for example 24 or 'Vivek'."

Blog ex 4.png

  • 12 // a number
  • “Hello World” // a string
  • 44 + 1 // a calculation
  • x = 44 + 1 // calculation
  • myVar // a variable
  • myFun() // a function that returns a value
  • Single Line of Code know as expression

Operatores in JS 🕹

Blog ex 5.png

We generally do the computation for every type of program using arithmetic operators or comparison operators. When we write code for two numbers that are odd or even, we must use operators. Every computer language or programming language supports these operators, and in some cases, programming languages include a pre-written method or function for calculation.