Unit 4: JavaScript Fundamentals - Subjective Questions

CSE326 — Internet Programming • Practice Questions with Detailed Answers

20 questions

1

Define JavaScript and explain its role in Internet programming.

2

Distinguish between var, let, and const in JavaScript with suitable examples.

3

Explain the primitive and non-primitive data types available in JavaScript.

4

Describe JavaScript operators and explain the major categories of operators with examples.

5

Compare the equality operators == and === in JavaScript. Why is strict equality generally preferred?

6

Explain operator precedence, associativity, and type coercion in JavaScript expressions. Evaluate the expressions 2 + 3 * 4, "5" + 2, and "5" - 2.

7

Explain strings in JavaScript and describe any five commonly used string properties or methods.

8

What are template literals? Explain interpolation and multiline strings with an example.

9

Explain JavaScript numbers, NaN, Infinity, and commonly used number-related methods.

10

Explain Boolean values, truthy values, and falsy values in JavaScript with examples.

11

Describe the if, if...else, and if...else if...else conditional statements in JavaScript.

12

Compare the switch statement and the conditional operator in JavaScript. State appropriate use cases for each.

13

Define a JavaScript function. Explain function declarations, function expressions, parameters, arguments, and return values.

14

Compare regular functions and arrow functions in JavaScript. Discuss their syntax and behavior of this.

15

Explain global scope, function scope, block scope, lexical scope, and variable shadowing in JavaScript.

16

What is a closure in JavaScript? Explain how it is related to lexical scope with a suitable example.

17

Explain how arrays are created, accessed, updated, and traversed in JavaScript.

18

Compare the array methods push, pop, shift, unshift, slice, and splice.

19

Explain the purpose of forEach, map, filter, find, and reduce. Use them to describe a data-processing sequence for an array of numbers.

20

Describe JavaScript objects and explain object creation, property access, property modification, methods, destructuring, and the spread syntax.