Skip to content

Instantly share code, notes, and snippets.

@pernstrong
Last active January 7, 2020 18:04
Show Gist options
  • Save pernstrong/c05209d6d5820af4448b6f74bcdffb98 to your computer and use it in GitHub Desktop.
Save pernstrong/c05209d6d5820af4448b6f74bcdffb98 to your computer and use it in GitHub Desktop.
Beginners Guide to data types

Beginners Guide to Data Types

String

What is a String?

A string is data type used to represent text.

Examples: Strings

  • "My favorite string is string cheese"
  • "Strings are part of any orchestra"
  • "The string beans are ready"
  • var greeting = "Hello, I am Dave."

Integer

What is an Integer?

An integer is a whole number.

Examples: Integers

  • 12
  • 100
  • -100
  • var favNum = 5 High Five

Float

What is a Float?

A float is a number with a decimal

Examples: Floats

  • 3.14159
  • 10.10
  • -65.342
  • var weight = 3.2

Boolean

What is a Boolean?

A boolean is a true/false

Examples: Floats

  1. True
  2. False

Array

What is an Array?

An array is a group of things

Examples: Arrays

  1. ["Lizards", "Wizards", "Gizzards"]
  2. [10, 20, 30, 40]
  3. [true, true, false, true, false, true, false]
  4. var myFavCats = ['Zora', 'Milo', 'Sox', 'Mr. Bill']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment