Top 100 JavaScript Interview Questions

Pravin M
119 min readAug 18, 2023
JavaScript Interview Questions

Source:- JavaScript Interview Questions

JavaScript Interview Questions For Freshers

  1. What are the data types in JavaScript ?

In JavaScript, data types can be categorized into two main groups: primitive and non-primitive (also known as reference types) data types. Here’s an explanation of each:

  1. Primitive Data Types:

These are immutable data types that store a single value.

a. Boolean: Represents a logical value, either true or false. It is commonly used for conditions and branching in JavaScript.

let isTrue = true;
let a=5;
let isFalse = false;
console.log(isTrue); // Output: true
console.log(isFalse); // Output: false

b. Number: Represents numeric values, including integers and floating-point numbers.

let count = 10;
let price = 4.99;
console.log(count); // Output: 10
console.log(price); // Output: 4.99
undefined

c. String: Represents a sequence of characters enclosed in single or double quotes. Strings are used to represent textual data.

let message = "Hello, world!";
console.log(message); // Output: Hello, world!
undefined

--

--