Understanding the call(), apply() and bind() methods in JavaScript.

These functions are very important for every JavaScript Developer and are used in almost every JavaScript Library or Framework. Check out the code snippet below.

Taken from the very popular library Lodash

Look at the statement on line 21, return func.apply(this, args.reverse())

In this article, we will have a…

We all are familiar with Arrays

Let us see some of the ways to create an array in JavaScript.

  1. Array Literal
let array = [1, 2, 3]console.log(array) // [1, 2, 3]

2. Array Constructor

let array = new Array(1 ,2 ,3)console.log(array) // [1, 2, 3]

3. Array.from()

Creates a new, shallow copied Array instance from and array-like or iterable object.

console.log(Array.from('JavaScript'))
// Output: ["J", "a", "v", "a", "S", "c", "r", "i", "p", "t"]

4. Array.of()

This method creates a new Array instance from a variable number of arguments, regardless of number or type of the arguments.

Array.of(7) // [7]
Array.of(1, 2, 3) // [1, 2, 3]

So these are the ways to create an Array in JavaScript.

Did I miss any other way? Let me know in the comments.

— Aniket Kudale

A CSS selector can contain more than one simple selector. Between the simple selectors, we can include a combinator.

A combinator is something that explains the relationship between the selectors.

There are four different combinators in CSS:

  • Descendant Selector (space)
  • Child Selector (>)
  • Adjacent Sibling Selector (+)
  • General Sibling Selector…

Aniket Kudale

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