Skip to content

Instantly share code, notes, and snippets.

@deborahtrez
Created April 12, 2021 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deborahtrez/baae4101713ba0e22133c78a6a3e6a16 to your computer and use it in GitHub Desktop.
Save deborahtrez/baae4101713ba0e22133c78a6a3e6a16 to your computer and use it in GitHub Desktop.
Tungatech lesson #1 - ES6 restrict variable names to datatypes
//type number
let num:number;
//number aray
let myNumArray:number[]
myNumArray = [1, 3, 6]
//string array
let myStringArray:string[] = ["hello", 'hhh']
//boolean array
let myBooleanArray:boolean[] = [true, false]
//type object
let myObj:object = {
name: "Eric",
age: 30
}
//type object Array
let myObjArray:object[] = [
{name: "Eric", age: 30},
[1, 2, 3]
]
//type any
let someVariable:any = [30, "gig"]
someVariable = true
//console.log(someVariable)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment