Regex Quantifiers +, *, ? and {} in Javascript

Let’s get started first using {} quantifier.

Exact count: {5}

\d{5} denotes exactly 5 digits, the same as \d\d\d\d\d.

The example below looks for a 5-digit number:

console.log( "I'm 123456 years old".match(/\d{5}/) ); // "12345"

Shorthands

[...]

Continue reading

  • 249
  • 308
  • By Bablu Ahmed
  • Posted 1 year ago

What are Objects in JavaScript

In Javascript, objects are made by other objects. An object is a collection of key-value or name-value pairs. Each key-value pair is called a property.

A property’s value can be a function, an array, an object itself or any primitive data type [...]

Continue reading

  • 249
  • 308
  • By Bablu Ahmed
  • Posted 9 months ago

Prototypes in JavaScript

All objects in JavaScript are instances of Object like a father of a Nation. When an object is created that inherits properties (including methods) from Object.prototype. These properties can be shadowed (overridden). When a constructor functio [...]

Continue reading

  • 249
  • 308
  • By Bablu Ahmed
  • Posted 9 months ago