Skip to content

Instantly share code, notes, and snippets.

@stevecalla
Last active October 17, 2020 19:26
Show Gist options
  • Save stevecalla/a5bfa43dcf5e305822e7a98da0bc66fb to your computer and use it in GitHub Desktop.
Save stevecalla/a5bfa43dcf5e305822e7a98da0bc66fb to your computer and use it in GitHub Desktop.

Objective: Document data types knowledge using Markdown

Based on Turing Mod0 Class 1 on Monday 10/5/2020

Instructor: David Whitaker

There are at least 6 different data types

  1. Strings
  2. Integers
  3. Floats
  4. Boolean
  5. Array
  6. Extensions

Here is an example of each data type:

  • String is text. Example is "hello" or 'hello' (don't forget the quotations, please).
  • Integer is a whole number (positive or negative). Example is 10, 0, or -25.
  • Float is a number with decimals (positive or negative). Example is 5.5 or -0.001.
  • Boolean is a true or false value/indicator. An example is a conditional statement such as if x >= 5.
  • Array is a collection of values. Example is formated as such [26,24,27] or ["a","b","c"]. It's best to have one data type within an array for coding simplicity (meaning to be able to manage/work with the values in an array) although it is possible to have multiple data types.
  • Extension is data where pairing or coupling information is important. An example is as follows { "9th grade": 110, "10th grade": 125, "11th grade": 66, "12th grade": 70}. It's important in this instance to pair the grade (9th with the room of 110. Another example is { "Mod 0": "Tim and David", "Mod 1": "Mike and Sal", "Mod 2": "Brittany and Robbie" }

Here is a javascript code block with some data type examples.

var pizza = "the best food of all time";      //string example
var isHungry = true;
var number = 5;                               //integer example
// reassign number
console.log("number = "+number)
number = 4;                                   //integer example
console.log("number reassigned to "+number)
var teachers = ['Ellen','Robert','David']     //array example
console.log(teachers)
var pizzaType = "Pepperoni pizza is"
var output = pizzaType + " " + pizza
console.log(output)
var number2 = 5                               //integer example
number * number2
console.log(number+"*"+number2+"="+number * number2)

Here's a useful image of javascript data types.

alt text

Helpful References Include:

  • Mod0 Session 1 Data Type Information LINK
  • Markdown: Basic writing & formatting LINK
  • Markdown: Cheatsheet LINK

HOMEWORK ASSIGMENTS

  • Document data type information
  • At least two headings of different sizes
  • At least one numbered list
  • At least one bullet point list
  • At least one bold word/phrase
  • At least one italic word/phrase
  • At least one code block
  • At least one inline code block (greyed text)
  • At least one image
  • Bonus - hyperlink
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment