Double equal (==) vs triple equal (===)

10 === '10'    // false
5 === 5 // true
10 == '10'      // true
1 == true // true

Truthy value vs falsy value


What is ReactJS

JSX

const myElement = React.createElement('h1', {style: {color: ‘red’}}, 'Hello World!');

ReactDOM.render(myelement, document.getElementById('root'));
const myelement = <h1>Hello World!</h1>;

ReactDOM.render(myelement, document.getElementById('root'));

Using JS in react


Var Declarations and Hoisting

function getColor(value) {
if(value > 20) {
var color = 'red';
return color;
} else {
console.log(color) // no error. color is undefine
return "blue";
}
// color is also accessible from here with the value undefine}
function getColor(value) {  var color;  if(value > 20) {

Array.prototype.push()

let numbers = [5, 10, 20];
let item = 30;
numbers.push(item); // numbers will be [5, 10, 20, 30]

Array.prototype.pop()

let language = ['C', 'C++', 'JavaScript', 'Python'];
console.log(language.pop()); …

SAYEM MD. NAFI

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