Promises are in many ways the logical next step from callback. A promise is just a special object that promise to either resolve, or throw an exception.
One of the big issues with using either callbacks or Promises is that the code becomes much more complex that it would, if you were using a synchronous programming language. This is where async and await comes in.
In this article we will try to get a clear idea about Slice or Splice which one is better to use…
Slice is a method on the Array Prototype that you can use to extract a section of a array. Let’s say you want to remove the first two elements from a array.
As a coder or an aspiring one you have probably experienced many moments where all the smokes blows away and you understand something much clearer. One of these moments for me was when I was introduced to recursion. Probably, while learning Scheme or Haskell.
I ended up having to wade through a sea of ambiguous and seemingly conflicting results:
“ECMAScript is a standard.”
“ECMAScript is a specification.”
ES6 introduced two types of literals: Template Literals and Tagged Template Literals to tag Template Literals. In this post, we cover both of them in depth!
In ES6, two types of literals were introduced:
- Template Literals for string concatenation and expression embedding in a string
- Tagged Template Literals to tag the Template Literal in a function so the literal can be evaluated in the function
The DOM has two approaches for object to sense events: first is top down approach and second is bottom up approach. Top down approach is called event capturing whereas bottom up is known as event bubbling.
How to Follow Along
It’s about to get weird — and you’re going to want to follow along with me. You can open up your Chrome Developer Console with: (Windows: Ctrl + Shift + J)(Mac: Cmd + Option + J). This will allow you to type all of the following code into your browser so you can see in real time what is happening…
3 + true == 4
There are a number of other new features and APIs that need attention, as well. The largest of which are Strict Mode and native JSON support.
Strict Mode is a new feature in ECMAScript 5 that allows you to place a program, or a function, in a “strict” operating context. This strict context prevents certain actions from being taken and throws more exceptions (generally providing the user with more information and a tapered-down coding experience).