Created
April 12, 2021 15:14
-
-
Save deborahtrez/baae4101713ba0e22133c78a6a3e6a16 to your computer and use it in GitHub Desktop.
Tungatech lesson #1 - ES6 restrict variable names to datatypes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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