Skip to content

Instantly share code, notes, and snippets.

Understanding Hoisting in JavaScript

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

Difference between call Apply and Bind function in javascript? explain with example

  1) Call invokes the function and allows you to pass in arguments one by one.

  2) Apply invokes the function and allows you to pass in arguments as an array.

  3) Bind returns a new function, allowing you to pass in a this array and any number of arguments.

Apply vs. Call vs. Bind Examples:

JavaScript primitive data types

In JavaScript, a primitive (primitive value, primitive data type) is data that is not an object and has no methods. There are 7 primitive data types: string, number, bigint, boolean, undefined, symbol, and null.

ES6 main topics

1. Let & Const
2. Template String
3. Arrow function
4. DeStructuring
5. Object Props
6. Default Argument
7. Arrays in ES6
8. New No. Methods
  1. New Global Methods

JIT - Compile TypeScript just in time for executing it.

Compiled in the browser.

Each file compiled separately.

No need to build after changing your code and before reloading the browser page.

Suitable for local development.

What is Lazy loading in angular

Lazy loading is most useful concept of angular routing and bring down the size of large file. This is done by Lazy loading the files that is required load occasinally. Angular 8 comes with support dynamic imports in our routing configuration.

Difference between Promise and Observable in angular

Promise:
Return single value
Not cancellable
More readable code with try/catch and async/await
Observable: