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"

ShorthandsContinue reading

  • 249
  • 308
  • By Bablu Ahmed
  • Posted 10 months 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 i.e. integer, string, etc. in which case t [...]

Continue reading

  • 249
  • 308
  • By Bablu Ahmed
  • Posted 7 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 (overridde [...]

Continue reading

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