JavaScript You need to know(ES6)

Rakibur
2 min readMay 4, 2021

--

We have to know the fundamentals to go forward in the next level. Whenever we are going learn any of JavaScript library or Framework ES6 is the most important. JavaScript has few types which are the core fundamentals of this language. They are,

1) String

2) Number

3)Function

4) Array

5) Boolean

There are also few types of JavaScript’s are undefined, null etc.

String

String is the sequence of character. For Example ‘Rakibur’ is String which has 7 character’s.

const myself = ‘Rakibur’

console.log(myself.length()) // Find the length of the character = 7

You Can Find the position of any of the character. you can do it with

console.log(myself.charAt(0)) // index start’s with 0 . output is R

Join the two words with join() method. For Example

const name = [‘Rakibur’ , ‘Rahman’]

console.log(name.join()) // output is “Rakibur, Rahman”

Concat() is the method to add string

const a = ‘Rakib’

const b = ‘Rahman’

console.log(a.concat(b)) //output is RakibRahman

There are many method’s in String. Most used method’s are replace(), charAt(), toUpperCase(), toLowerCase(), length(),slice(),splice(),split().

Number

There are few types of number in all programming language .They are Int, Float.

int is the primitive datatype. that means 1,2,3,4,5,6. on the other hand Float is a Fraction of numbers . For example 2.48,3.22,10.10 etc.

There are some methods in JavaScript where a String can convert into a number. method is parseInt()For example,

const a = parseInt(‘1221’) //here ‘1221’ is the string type

console.log(a); //output 1221

Similar for the parsefloat() as well .

Array

First of all we need to understand what is an array? Array is the collection of data. where data can be String or Number type. for Example,

const name = [‘messi’,’ ronaldo’, ‘neymar’] //here they are the string type

const number = [21,12,34,64,65] //these are number type.

Array has used in many ways. It can push(),pop(),slice(),splice(),shift(),unshift(),map(),forEach() and many more.

All has the different types of activities in the array. For example push() method can add item in the last where as pop() can delete from the last.

const number = [1,2,4,5]

console.log(number.push(7)) //output is [1,2,4,5,7]

Boolean

Boolean is the method of JavaScript where it return’s true and false.

Example, const Boolean(10>9) // output is True

Function

In ES6 we don’t write the function like this function(add). Instead of this we can use, const add=(x,y)=> x +y . Nowadays it’s become more popular than ever. Specially when we working on React, vue or Angular it become more popular day by day.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Rakibur
Rakibur

Written by Rakibur

0 Followers

I am a web developer. Currently working on JavaScript and React.

No responses yet

Write a response