Null vs Undefined

null == undefined // true
null === undefined // false

Truthy and Falsy values

Double Equal(==) vs Triple Equal(===)


Raw Code vs React Code:

with web DOM API

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

with React’s API

ReactDOM.render(
React.createElement(
'h1',
null,
'Hello React',
),
document.getElementById('title'),
);

Getting Started

npx create-react-app your-app
cd your-app
npm start
your-app/
README.md
node_modules/
package.json
public/
index.html [This…

Coding Style

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

return result;
}
let num= prompt("x?", "");
let sup= prompt("n?", "");
if(num < 0) {
alert(`${num} is not valid,
please enter a non-negative integer number`);
} else {
alert( pow(num, sup) );
}

Curly Braces

if (n < 0) {alert(‘${num} is not valid’);}
or,
if (n < 0)
alert(‘${num} is not…

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’;const str2 = ‘World’;console.log(str1.concate(‘ ’ ’, str2));Easy Way: console.log(str1 + ‘ ‘ ’ + str2);

5) Delete a specific element from an array in JavaScript Array:

const name = [ Badhan, Aakash, KKK, Puja, Chalantica ];name.splice( name.indexOf(‘KKK’), 1 );console.log(name);

6) Clear concept about split(), slice() and replace :-

split() can convert a string into an array of sub-stringconst sentence = ‘The quick brown fox jumps…

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