JavaScript
  • JavaScript Introduction
  • JS Engine
  • V8 Engine
  • First-class function
  • Optimized Code
  • Call Stack & Memory heap
  • Single Thread
  • JavaScript RunTime
  • Nodejs
  • Context and Environment
  • Hoisting
  • Functions
  • Arguments
  • Variables
  • Scope
  • IIFE
  • this
  • call(), apply() and bind()
  • currying
  • Types
  • Type Coercion
  • Functions as Object
  • HOF (Higher Order Function)
  • Two pillars of Javascript
  • Closures
  • Prototypal Inheritance
  • OOP and FP
  • OOP
    • 4 principles of OOP
  • FP
    • Pure function
    • Imperative vs Declarative
    • Immutability
    • HOF and Closures
    • Currying
    • Partial Application
    • Compose and Pipe
  • Composition vs Inheritance
  • OOP vs FP
  • JS working
  • Promises
  • Async Await
  • ES5 - ECMAScript 2009
  • ES6 - ECMAScript 2015
  • ES7 - ECMAScript 2016
  • ES8 - ECMAScript 2017
  • ES9 - ECMAScript 2018
  • ES10 - ECMAScript 2019
  • ES11 - ECMAScript 2020
  • ES12 - ECMAScript 2021
  • JOB Queue
  • Promises Execution
Powered by GitBook
On this page

Was this helpful?

Optimized Code

Some of the code/syntax to be avoided in JavaScript programming.

  • eval() - window object, we do not call eval() to evaluate an arithmetic expression; JavaScript evaluates arithmetic expressions automatically. Ex: var x = 10; var y = 20; var a = eval("x * y") // 200

  • arguments - in functions

  • for in - for looping the objects use object.keys instead

  • with - we can access the object properties directly. Ex: with(Math) { console.log(PI) }; instead using console.log(Math.PI)

  • delete - to delete the object keys Ex: delete Math.PI;

  • Hidden classes

  • Inline caching

PreviousFirst-class functionNextCall Stack & Memory heap

Last updated 5 years ago

Was this helpful?