JavaScript DataTypes

TumpaDey
Nov 3, 2020

--

Primitive Values: a primitive is a fundamental data type that cannot be broken down into a more simple data type. For example, an integer is a primitive data type, while an array, which can store multiple data types, is not.

Types of Primitive Values: There are 6 primitive data types: string, number, bigint, boolean, undefined, and symbol.

●Undefined​ (undefined), used for unintentionally missing values.
● Booleans​ (true and false), used for logical operations.
● Numbers​ (-100, 3.14, and others), used for math calculations.
● Strings​ (“hello”, “abracadabra”, and others), used for text.
● Symbols​ (uncommon), used to hide implementation details.
● BigInts​ (uncommon and new), used for math on big numbers.

Object & Function: Objects and Functions​ are also values, but they are not primitive. This makes them very special. Go ahead and log a few of them to the browser console:

console.log({});
console.log([]);
console.log(x => x * 2);

Error Handling & try-catch:

Error handling: Error handling refers to the routines in a program that respond to abnormal input or conditions. The quality of such routines is based on the clarity of the error messages and the options given to users for resolving the problem.

try-catch: The statement marks a block of statements to try and specifies a response should an exception be thrown.

--

--

TumpaDey
TumpaDey

Written by TumpaDey

0 Followers

I have keen interest in learning programing and coding is my passion. I want to be a skilled web developer so that I can share my ideas and thought by creating

No responses yet