Null vs Undefined

null == undefined // true
null === undefined //…

Raw Code vs React Code:

with web DOM API

document.getElementById(‘title’).innerHTML = `
<h1>
Hello HTML
</h1>
`;

with React’s API

ReactDOM.render(…

Coding Style

function pow(num, sup) {
let result = 1;
for (let i = 0; i < sup; i++){
result *= number;
}

return result;
}
let…

1) Always we use the toUpperCase() or, toLowerCase() method to convert a string into capital or smaller letter. But, if we need to convert only the first letter into the capital letter, we need to use:-

const name = ‘badhan’;console.log(name[0].toUpperCase() + name.substr(1, name.length));or,newName = name[0].toUpperCase() + name.substr(1, name.length);console.log(newName);

2) To check whether a word is present or, not,

const sentence = ‘The quick brown fox jumps over the lazy dog’;console.log(sentence.includes(cat)); //falseconsole.log(sentence.includes(dog)); //true

3) To remove Unnessacery white space of any user input,

const input = ‘ This is JS Magic ’;console.log(input.trim()); //This is JS Magic

4) Easy Way to concate two string

const str1 = ‘Hello’;

Badhan Chandra Barman

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