Basic’s of JavaScript

console.log('Hello World');             // Hello World
console.log(3 + 2);             // 5console.log(3 - 2);             // 1console.log(3 * 2);             // 6console.log(3 / 2);             // 1.5console.log(3 % 2);             // 1
parseInt('123', 10); // 123parseInt('F', 16); // 15parseInt('17', 8); // 15parseInt('Rafi', 10);  // NaN
Number.isNaN(NaN); // trueNumber.isNaN('javascript'); // falseNumber.isNaN('1'); // false
'Rafi'.charAt(0);         // "R"'hello, guys'.replace('guys', 'rafi'); // "hello, rafi"'aman'.toUpperCase(); // "AMAN"
'Barcelona'.charAt(1);    // "a"B a r c e l o n a
0 1 2 3 4 5 6 7 8
'Madrid'.charAt(3); // "r"M a d r i d
0 1 2 3 4 5
'hello, guys'.replace('guys', 'rafi'); // "hello, rafi"
'aman'.toUpperCase(); // "AMAN"
let movies = ['Pulp Fiction', 'Schindler’s List'];let first = movies[0] //           Pulp Fiction
let newMovie = movies.push('Forest Gump');// ["Pulp Fiction", "Schindler’s List", "Forest Gump"]
let last = movies.pop() // remove Forest Gump (from the end)// ["Pulp Fiction", "Schindler’s List"]let first = fruits.shift() // remove Pulp Fiction from the front// ["Schindler’s List"]

Learner | Enthusiastic | Noob Programmer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Introducing ShopBack Lite

Honey, I shrunk the bundle 📦— A story about Angular bundle size reduction

I Tend to Focus More on Self Growth as a Developer

How to contribute to an open-source project and make a PR?

How to Use JavaScript Classes for Object-Oriented Programming

JavaScript Essentials: functions are fun (and VIP) — if you understand them

Learn js with babeljs

Modules in Node.JS

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rafi Aman

Rafi Aman

Learner | Enthusiastic | Noob Programmer

More from Medium

What is JavaScript?

The equality (==) and strict equality (===) operators in JavaScript

Events, Arrow functions, and DOM manipulation in JavaScript

FUN…ctions in Javascript