Skip to content

Instantly share code, notes, and snippets.

@Andrey-1992
Last active February 4, 2021 08:00
Show Gist options
  • Save Andrey-1992/0ea9dc5c13e35eb8f5fc2ec900b95274 to your computer and use it in GitHub Desktop.
Save Andrey-1992/0ea9dc5c13e35eb8f5fc2ec900b95274 to your computer and use it in GitHub Desktop.
andrey_bermudez_markdownPractice.md

"Beginners Guide to Data Types in JavaScript"

There a 5 different types of data types on JavaScript:

-String

-Integer

-Boolean

-Array

-Object

  1. String: The string data type is used to represent textual data. Strings are created using single or double quotes surrounding one or more alphabet characters, spaces, numbers and special characters.Example:

var projectName = "Data types"

  1. Integer: This data type is used to represent positive or negative numbers with or without decimal place, or numbers written using exponential notation.Example:

var myAge = 28

  1. Boolean: The Boolean data type can hold only two values: true or false. It is typically used to store values like yes (true) or no (false), on (true) or off (false).Example:
var isLoggedIn = true
  1. Array: An array is a type of object used for storing multiple values in single variable. Each value in an array has a numeric position, known as its index, and it may contain data of any data type-numbers, strings, booleans, functions, objects, and even other arrays.Example:
var godfatherTrilogy = ["Mov 1", "Mov 2", "Mov 3"]
  1. Object: An object contains properties, defined as a key-value pair. A property key is always a string, but the value can be any data type, like strings, numbers, booleans, or complex data types like arrays, function and other objects.Example:

var dataTypesAssigment = { data 1: ["String"], data 2: ["Integer"], data 3 ["Boolean"], data 4 ["Array"], data 5 ["Object"]}

JavaScript Logo

alt text

⚡️ TURN THIS SENTENCE INTO A LINK TO YOUR GIST ⚡️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment