JavaScript Hoisting

In this section I will discuss how to treat hoisting mechanisms in javascript. Before start at the first we can briefly understand what is hoisting

Hoisting is a JavaScript mechanism where variables and function declarations are moved to the top of their scope before code execution.

This means that no matter where functions and variables are declared, they are moved to the top whether their scope is global or local.

Execution context hoisted variable decaleration only:

console.log(name); // Output: undefined

var name = ‘John Due.’;

Because javascript only hoisted our variable declaration not initialization.

Execution context hoisted function…


What is React

React is a JavaScript library for building user interfaces. React is painless for developers making interactive UI. It is not a complete solution. library does not assume anything about the other parts in any solution. The library follows the Unix philosophy because it is just a library that focuses on just one thing and on doing that thing extremely well. That “one thing” is the second part of the React definition: Building User Interfaces.

React is a declarative and components based library. React has two types of components one of class based and another one is function…


This blog is easily explained with an example and just a simple introduction on this topic. If someone earns more interest they can look for a more brief solution.

Data Types / Value Types:

JavaScript programs manipulate values, and those values all belong to a type. JavaScript’s types are:

  • String
  • Boolean
  • Function
  • Object
  1. 2.Array

3.Date

4.RexExp

  • undefined
  • null

There are different types of data that we can use in a JavaScript program.

Example:

const num = 5;

const name = “John”;

Here,

  • “Hello” is string data.

Note: all data types…


Convert String to Number:

We know basically when we need a string type number to convert to a number type then use parseInt(), parseFloat() function to convert it. But we can do this task with a small trick by using the unary (+) operator.

Example:

const typeString = ‘5’;

const typeNumber = + typeString; // +’5'

//typeString = ‘5’ will be equal to typeNumber = 5;

// just use unary + operator as prefix any of situation

Note:

don’t use unary (+) operator when string is not a number format like

const stringValue = ‘10xyz’;

const numberValue = +’stringValue’; //NaN

Different…

Ashraful-mijan

I am a hard working individual web developer with deep knowledge and proficiency in front-end technology

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