Sitemap
codeburst

Bursts of code to power through your day. Web Development articles, tutorials, and news.

Follow publication

JavaScript Data Types Explained

2 min readSep 11, 2017

--

JavaScript Data Types Explained

Two Kinds of Data

Boolean

var boo1 = true;
var boo2 = false;

Number

var num1 = 32;
var num2 = +Infinity;

String

var str1 = 'hello, it is me';
var str2 = "hello, it's me";

Null

var nothing = null;

Undefined

var testVar;
console.log(testVar); // undefined

Symbol

const mySymbol = Symbol('mySymbol');

What about Objects?

var obj = {
key1: 'value',
key2: 'value',
key3: true,
key4: 32,
key5: {}
}

Loosely Typed

var car = 'ford';
car = 1998;

Closing Notes:

If this post was helpful, please click the clap 👏button below a few times to show your support! ⬇⬇

--

--

codeburst
codeburst

Published in codeburst

Bursts of code to power through your day. Web Development articles, tutorials, and news.

Brandon Morelli
Brandon Morelli

Written by Brandon Morelli

Creator of @codeburstio — Frequently posting web development tutorials & articles. Follow me on Twitter too: @BrandonMorelli

Responses (7)