Today I will talk about some fun things about JavaScript. You already know this topic. I will try to explain it in a simple way.

Sr Sohan
Nov 3, 2020

1. try…catch

Sometimes our scripts have errors. Look at the picture above. try method has an error. It finds a variable of name hi, so So the try execution is stopped, and control flows to the beginning of catch(err)

2.Primitive

In JavaScript, a primitive is a data that is not an object and has no methods. There are 6 primitive data types.

String for the string primitive.

Number for the number primitive.

BigInt for the bigint primitive.

Boolean for the boolean primitive.

Symbol for the symbol primitive.

3.typof

The typeof the operator returns a string indicating the type of the unevaluated operand.

The picture above shows what kind of operand it is. This is the object operand

4.Best practice of single-line comments and multiple line comments:

JavaScript comments can be used to explain JavaScript code, and to make it more readable.

Single line comments start with //
Multi-line comments start with /* and end with */

5.Coding style Guide

When writing our code, we need to write in a simple way so that everyone can understand our code.
We will name the variable meaningful name.
All variables names start with a letter
At we use camelCase for identifier names (variables and functions)

--

--