User Tools

Site Tools


programming:simple_data_types_js

Table of Contents

Simple Data Types

JavaScript is a loosely typed programming language, so you will not need to declare the data type of your variables, and you can freely change between them. Even so, it is still important to understand that there are different basic data types..

STRINGS:

A string is a series of characters that can be denoted with single (‘ ‘) or double (“ “) quotes.

Example:

var string1 = “this is a string”;
var string2 = ‘this is also a string.’;

NUMBERS:

Because JavaScript is a loosely typed programing language, all the types of numbers will interface with each other without any issue. It is important to note that numbers are not denoted with quotes, otherwise they will be read as a string, not a number.

Example:

var num1 = 10;
var num2 = 30.34;
programming/simple_data_types_js.txt · Last modified: 2020/10/01 20:47 by shapirofrosts