menu

JavaScript Basics

JavaScript Basics - Important Points


6. What does the isNaN() function in JavaScript do?

A. Determines if a value is a number or not.

B. Determines if a value is a string or not.

C. Determines if a value is undefined or not.

D. Determines if a value is null or not.

Discuss Work Space

Answer: option a

Explanation:

The isNaN() function in JavaScript determines if a value is a number or not. It returns true if the value is NaN or not a number, and false if the value is a valid number.

7. Which of the following is not a primitive data type in JavaScript?

A. string

B. number

C. boolean

D. object

Discuss Work Space

Answer: option d

Explanation:

Object is not a primitive data type in JavaScript. It is a complex data type that can contain multiple values and properties.

8. What does the keyword this refer to in JavaScript?

A. The global object

B. The parent object

C. The current object

D. The child object

Discuss Work Space

Answer: option c

Explanation:

The keyword this refers to the current object in JavaScript. It is a way to refer to the object that the code is currently executing within.

9. What does the delete operator do in JavaScript?

A. Deletes a variable

B. Deletes a property of an object

C. Deletes an element from an array

D. Deletes a function

Discuss Work Space

Answer: option b

Explanation:

The delete operator in JavaScript deletes a property of an object. It can be used to remove a property from an object or to free up memory by removing a reference to an object.

10. What is the difference between == and === in JavaScript?

A. There is no difference between == and ===.

B. == performs a strict comparison, while === performs a loose comparison.

C. === performs a strict comparison, while == performs a loose comparison.

D. == and === both perform a strict comparison.

Discuss Work Space

Answer: option c

Explanation:

=== performs a strict comparison, meaning it checks if the values being compared are of the same type and value, while == performs a loose comparison, meaning it will attempt to convert the values to a common type before comparing them.


Subscribe for Latest Career Trends
Subscribe Now
Use AI and ChatGPT for Career Guidance

Unlock Your Future

Join Now
Worried for Placements in 2024?

Join FAST TRACK Course

Join Now
Supercharge Your SUCCESS

Join All in One Placement Mock Tests-2024

Join Now