DEV Community

Jennifer Tieu
Jennifer Tieu

Posted on • Edited on

Self-Taught Developer Journal, Day 26: TOP JavaScript Fundamentals Part 2 - Data Types Overview

Today I learned...

BigInt

In JavaScript, the “number” type cannot represent integer values larger than (253-1) (that’s 9007199254740991), or less than -(253-1) for negatives.

  • Recently added to JS to represent numbers of unpredictable length
  • Created by appending "n" to the end of an integer
  • Useful for cryptography or microsecond-precision timestamps
  • Rarely needed

String: Type of Quotes

There are three types of quotes in JavaScript:

  1. Single Quote: '
  2. Double Quote: "
  3. Backticks: `

The single and double quotes have no difference between them.

The backticks are "extended functionality" quotes. This mean that not only do they define the string data type, but are also able to perform another function.
They allow us to embed variables and expressions into a string by wrapping them in ${…}.

let name = "Jennifer";

alert( `Hello, ${name}!` ); // Hello, Jennifer!

alert( `the result is ${3 + 4}` ); // the result is 7
Enter fullscreen mode Exit fullscreen mode

The expression inside ${…} is evaluated and the result becomes a part of the string.

Resources

The Odin Project
https://javascript.info/types

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more