A A scripting language
B A markup language
C A database
D An operating system
Explanation: JavaScript is a high-level, interpreted scripting language.
A var
B let
C const
D All of the above
Explanation: var, let, and const are all used to declare variables in JavaScript.
A null
B undefined
C object
D number
Explanation: typeof null returns 'object' due to a historical bug in JavaScript.
A JSON.stringify()
B JSON.parse()
C JSON.convert()
D JSON.toObject()
Explanation: JSON.parse() is used to parse a JSON string and create a JavaScript object.
Explanation: === is the strict equality operator, checking both value and type.
A push()
B pop()
C shift()
D unshift()
Explanation: push() appends elements to the end of an array and returns the new length.
A true
B false
C undefined
D NaN
Explanation: Due to floating-point precision, 0.1 + 0.2 does not exactly equal 0.3.
A String
B Number
C Float
D Boolean
Explanation: JavaScript has Number type, not Float. All numbers are floating-point.
A Refers to the current object
B Refers to the global object
C Refers to the parent object
D All of the above depending on context
Explanation: The value of 'this' depends on how a function is called (execution context).
A push()
B pop()
C shift()
D slice()
Explanation: pop() removes and returns the last element of an array.
A <!-- comment -->
B // comment
C /* comment */
D Both b and c
Explanation: Both // for single-line and /* */ for multi-line comments are valid.
A class
B function
C object
D new
Explanation: The 'class' keyword is used to define a class in ES6.
A array
B object
C undefined
D null
Explanation: Arrays are of type 'object' in JavaScript.
A length()
B len()
C size()
D length
Explanation: String length is accessed via the .length property, not a method.
A 4
B 22
C NaN
D TypeError
Explanation: When a number and string are added, the number is coerced to a string and concatenated.
A JSON.parse()
B JSON.stringify()
C JSON.convert()
D JSON.toJSON()
Explanation: JSON.stringify() converts a JavaScript object to a JSON string.
A false
B true
C undefined
D NaN
Explanation: !! converts a value to a boolean. Any non-empty string is truthy, so !!'false' is true.
A Object.create()
B new Object()
C {}
D All of the above
Explanation: All three methods are valid ways to create objects in JavaScript.
A Creates a new function with a specific this value
B Binds an event to an element
C Binds two objects together
D None of the above
Explanation: bind() creates a new function with a specified 'this' context and optional arguments.
Explanation: 1 + '1' results in '11', then '11' - 1 results in 10 (string coerced to number).