0% found this document useful (0 votes)
9 views

Javascript Interview Questions

JavaScript is a high-level, interpreted programming language primarily used for interactive web pages, differing from Java in being dynamically typed and using prototype-based inheritance. It has eight main data types, including primitive types like String and Number, and a non-primitive type, Object. JavaScript is executed line by line by an interpreter, making it suitable for automating tasks in web development.

Uploaded by

tiktakkids01
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Javascript Interview Questions

JavaScript is a high-level, interpreted programming language primarily used for interactive web pages, differing from Java in being dynamically typed and using prototype-based inheritance. It has eight main data types, including primitive types like String and Number, and a non-primitive type, Object. JavaScript is executed line by line by an interpreter, making it suitable for automating tasks in web development.

Uploaded by

tiktakkids01
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

JavaScript Interview Questions and Answers

Q: What is JavaScript and how is it different from Java?

A: JavaScript is a high-level, interpreted programming language mainly used for creating interactive

web pages. It can run in web browsers and on servers using platforms like Node.js.

Differences between JavaScript and Java:

- JavaScript is an interpreted scripting language; Java is a compiled programming language.

- JavaScript is dynamically typed; Java is statically typed.

- JavaScript uses prototype-based inheritance; Java uses class-based inheritance.

- JavaScript is mainly used for web development; Java is used in enterprise applications, Android

development, etc.

Q: What is meant by high-level, interpreted, and scripting language?

A: - High-level: Easy to read and write, closer to human language.

- Interpreted: Code is executed line by line by an interpreter, without needing compilation.

- Scripting: Automates tasks or controls other software; commonly used in web development.

Q: Explain the different data types in JavaScript.

A: JavaScript has 8 main data types:

Primitive Types:

- String: Text (e.g., "Hello")

- Number: Numeric values (e.g., 42, 3.14)

- BigInt: Large integers (e.g., 123n)

- Boolean: true or false

- Undefined: A variable declared but not assigned a value

- Null: An intentionally empty value


- Symbol: Unique and immutable identifier

Non-Primitive Type:

- Object: A collection of properties (e.g., { name: "John" })

- Includes arrays, functions, and more

You can check a variable's type using `typeof`.

You might also like