10 useful methods of javascript

  1. Number.isNaN
console.log(isNaN(‘a’*10)) // true
console.log(Number.parseInt('10', 2)) // 2
//10 is a binary form of 2
const str = 'I love Bangladesh'
console.log(str.contains('Bangla')) // true
console.log(str.contains('bangla')) // false
const str = 'Hello World'
console.log(str.replace('World', 'Earth')) // Hello Earth
const str = 'We are two brothers and two sisters'
console.log(str.replaceAll('two', 'three'))
// We are three brothers and three sisters
const name = 'Bill Gates'
console.log(name.toLowerCase()) // bill gates
const name = 'Melinda Gates'
console.log(name.toUpperCase()) // MELINDA GATES
const str = '    I love Bangladesh    '
console.log(str.trim()) // 'I love Bangladesh'
const str = 'I love Bangladesh'
console.log(str.slice(7)) // Bangladesh
const str = 'I love Bangladesh'
console.log(str.split(' ')) // ['I', 'love', 'Bangladesh']

--

--

--

I am Sajjad Amin. A passionate programmer. I always like to learn new technology.

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

Recommended from Medium

Angular Template Syntax: Directive, Interpolation, Property binding, Event binding

The best way to remember what a definite article is, is to remember that the word ‘the’ is the…

Sorting Algorithms, Part 1

Why appearances matter when sharing components

Javascript Trends in 2020

Understanding Bitwise Operations in Javascript

First Project with JS Frontend/Rails Backend

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
Sajjad amin

Sajjad amin

I am Sajjad Amin. A passionate programmer. I always like to learn new technology.

More from Medium

JS-12— JavaScript for Programmers, Chapter9, Part2

Context in Javascript an

Run Snippets of JavaScript code in Google Chrome

Special Concepts about JavaScript & MongoDB