Exercise

The symbol data type in JavaScript represents a unique identifier. Symbols are immutable and unique.

In JavaScript, you can declare a symbol variable using the Symbol() function.

javascript

var sym = Symbol();

The object data type in JavaScript represents a collection of properties, where each property has a key and a value.

In JavaScript, you can declare an object variable using curly braces {}.

javascript

var person = { name: 'John', age: 30 };

The typeof operator is used to determine the data type of a value or an expression in JavaScript.

Type coercion in JavaScript refers to the automatic conversion of data types during the evaluation of expressions.

Implicit type coercion in JavaScript occurs when the data type of a value is automatically converted during the evaluation of an expression.

Explicit type coercion in JavaScript occurs when the data type of a value is manually converted using built-in functions or operators.

The == operator in JavaScript performs type coercion, while the === operator does not perform type coercion and checks both value and type.

You can convert a string to a number in JavaScript using the parseInt() or parseFloat() functions.