1. Truthy vs Falsy

We can check the condition in if/else the statement in Programming Language. We can pass boolean (true/false)in the if condition. in JavaScript some value is being truthy or falsy. Truthy means true & falsy means false .

2. null vs undefined

null It’s a value. If there is no value in anything, we set a value of null. and when we can not set any value or When we forgot to set any value.

let name = null;
console.log(name); …

React is a front-end JavaScript library created by Facebook. It follows a component-based approach that helps create reusable UI elements.

1. JSX in React

Usually JSXjust syntactic sugar for React.createElement(component, props, ...children)

The JSX code :

Compile into :

2. JavaScript Expressions as Props

We can pass any javascript expression in props with {} . Flowing the example below :

For Component , the have value props.sum will be 15 . because the expression is 5 + 6 + 1 .

3. String Literals

We can pass a string as a prop. there two JSX…


1. Default parameters

In general, the default value of the function parameter in JavaScript is undefined. Notice the following example: If you do not give any value of num2 while making a sum call here, num2 = undefined in the sum function, And num1 + num2 will give sum = NaN

console.log(sum(25)) // NaN
console.log(sum(25, 5)) // 30

But the parameters of the function can be set by default in ES6. The following example is shown by setting num2 = 0as the default value:


JavaScript is a client-side and server-side scripting language that is embedded in HTML pages and understood by web browsers and It is also an object-based programming language. The language is embedded in general-purpose core Netscape, Internet Explorer, and other web browsers.

1. String.charAt()

charAt takes an index as a parameter. Its default value is 0 and it can take up to `String.length-1` value. The function of charAt is to print the value of the number given as an index in it.

2. String.toLowerCase()

The function of the toLowerCase() method is to convert strings to lowercase.

Hossain Rabbi

Front-End Developer

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