10 JavaScript topics that you should know.

if (true) {
// execute something
}
for( i = 0; i < 5 ; i++) {
// execute something
}
let a = 5;
console.log(a); // 5
a = 6;
console.log(a); // 6
const b = 5;
console.log(b); // 5
b = 6; // It will throw an error.
const compare1 = ( 18 == '18');
console.log(compare1); // true
const compare2 = (18 === '18');
console.log(compare2); // false
const product = {
name: 'Camera',
for: 'Roky'
};
console.log(product.name);
const product = {
name: 'Camera',
for: 'Roky'
};
console.log(product['name']);
parseInt('Hello World', 10); // NaN
const a = NaN + 5;
console.log(a); // NaN
a = NaN;
console.log(iSNaN(a)) // true
console.log(isNaN(5) // false
console.log(isNaN('I love Bangladesh')) // true
const cat = 'Mini';
cat.charAt(1) // i
const a = '3' + 4 + 5;
console.log(a); // '345'
const b = 4 + 5 + '5';
console.log(b) // '95'
let people = ['Roky', 'Tamim', 'Mushfiq'];
people.unshift('Shakib');
console.log(people); // ['Shakib', 'Roky', 'Tamim', 'Mushfiq']
const array = [4, 3, 8, 7];
console.log(array[array.length - 1]) // 7
const a = Math.floor(Math.random() * 10) + 1;
console.log(a); // a random number from 1 to 10
var fruits = [4, 3, 8, 7];
fruits.sort();
console.log(fruits) // 3, 4, 7, 8

--

--

--

I am an enthusiastic JavaScript developer with knowing some framework for the frontend and the backend.

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

Recommended from Medium

Generating A Random Code In Your Field Input / Form

罷 (Japanese Kanji) — quit, stop, leave, withdraw, go

Scope and Closure in Javascript

a meme about closure — a large man labeled “inner function” carrying a massive backpack labeled “secret variables from outer function”

YouTube Video | Understanding React Hooks

Leetcode 1869. Longer Contiguous Segments of Ones than Zeros

Dynamically populating components using list in VueJS

re-start: write once, run anywhere

Reasons That Advocates for Angular 8 Importance!!

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
Roky Das

Roky Das

I am an enthusiastic JavaScript developer with knowing some framework for the frontend and the backend.

More from Medium

Top JavaScript Skills Earnest for Developers to Include in Their Arsenal

Application Development Principles and JavaScript

TwiL: Week 6 — Javascript!

DOMinating the DOM.