Sign in

1. How to convert inch to feet

const inch = 50;

const inchToFeet = () => {

const feet = inch/12;

const fixedFeet = feet.toFixed(2)

return fixedFeet;

}

console.log(inchToFeet(), 'feet');

2. What is different between const and let variable type?

Const type variable will not reusable I mean we cannot set a new value.

Let type variable can set new value but not usable out of scope.

3. How to check LeapYear?

const checkYear = 2020;

if(checkYear % 4 === 0){

if(checkYear % 100){

if(checkYear % 400){

console.log(`${checkYear} is Leap year`);

}else{

console.log(`${checkYear} is not Leap year`);

}

}else{

console.log(`${checkYear} is not Leap year`);

}

}else{

console.log(`${checkYear} is not Leap year`);

}

4. How to get factorial in easy function?

const factorial = (num) => {

if(num < 0){

return…


React is defined as a Javascript library for building user interfaces.React work with DOM. DOM is “Document Object Model”The DOM API can be used to change a document structure, style, and content.

If someone asked you to give one reason why React is worth learning, this outcomes-based UI language is it. I call this language “the React language”.

JSX In Depth

JSX stands for JavaScript XML

React.createElement(component, props, ...children)

we write code in JSX :

<MyButton color="blue" shadowSize={2}>
Click Me
</MyButton>

and it works on compile like:

React.createElement(
MyButton,
{color: 'blue', shadowSize: 2},
'Click Me'
)

Component in JSX

User-Defined Components Must Be Capitalized

When an…


Data types

Mainly 3 types: Primitive, Object, Function

Types of Primitive value are:

  1. Undefine
  2. Null
  3. Boolean
  4. Number
  5. Strings
  6. Symbols
  7. BigInts

Coding Style

the right way to the right coding

No one likes reading long line code.

Try Catch:


When used as a function, Number(value) converts a string or other value to the Number type. If the value can't be converted, it returns NaN.

Number('abc');
output: NaN

The maximum safe integer in JavaScript (253 - 1).

The minimum safe integer in JavaScript (-(253 - 1)).

NaN = Not a Number


The startsWith() the method determines whether a string begins with the characters of a specified string, returning true or false as appropriate.

const str1 = ‘Saturday night plans’;

console.log(str1.startsWith(‘Sat’));
// expected output: true

The endsWith() the method determines whether a string begins with the characters of a specified string, returning true or false as appropriate.

const str1 = ‘Cats are the best!’;

console.log(str1.endsWith(‘best’, 17));
// expected output: true

const str2 = ‘Is this a question’;

console.log(str2.endsWith(‘?’));
// expected output: false

The indexOf() the method returns the index within the calling String the object of the first occurrence of the specified…


JavaScript’s syntax is based on the Java and C languages

Arrayis a special kind of object.

0, empty strings (""), NaN, null, and undefined all become false.

let allows you to declare block-level variables. The declared variable is available from the block it is enclosed in.

const allows you to declare variables whose values are never intended to change. The variable is available from the block it is declared in.

var is the most common declarative keyword. It does not have the restrictions that the other two keywords have. This is because it was traditionally the only way to declare…

Nimur Hasan

I’m Md Nimur Hasan, a MERN Stack Developer. I know MongoDB, express, react, node js, and continue deep learning on these.

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