Let’s take a stroll into JavaScript Part -2

Arafat Hosain
1 min readMay 7, 2021

What is a primitive data type?

There are some terms in JavaScript such as “String”, “Number”, “Null”, “undefined”, “Boolean” etc., these are called Primitive data. These are not objects and they don’t have any methods!

What is trying…catch?

Well, what is try and catch! Let’s find out! Every programmer scratches their head on one thing and that error in the code. Every programmer has to face them every day!

So normally when you have an error in code, it dies! But this syntax allows catching the error!

The process is basically is, you put the code in the try section

Then if there is an error it shows or it skips it

Comments

So, this is pretty basic I suppose! Whatever you write in editor it compiles and shows an output .but Starting with // and multiline: /* ... */. , anything inside this is not shown in output! Comments are used occasionally to leave a note in the code and state separate sections

Typeof()

In programming, data types are an important concept. The method is used when you want to know specific types of data! When you are working with a certain function, sometimes it’s important to declare the types of data!

Arrow Function

Arrow functions is an upgrade version of JavaScript call ES6.it’s far easier to call this as a function and use it! It only takes one line! The best thing is the function needs no name!

For example:

const sayHiStranger = () => 'Hi, stranger'

--

--