Created
August 13, 2015 20:29
-
-
Save khaosans/c441de082c68b44f70a6 to your computer and use it in GitHub Desktop.
JSX DEMO
This file contains 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
log "Hello, world!"; | |
//declare the stuff | |
var s: string; | |
var n: number; | |
var b: boolean; | |
//set the stuff here | |
s = "helo"; | |
n = 10; | |
b = true; | |
//output the vars | |
log s; | |
log b; | |
log n; | |
var d = new Date(); | |
var a = new Array.<string>(); | |
a = ["1","2"]; | |
var a1 = {} : Map.<number>; | |
var m1 = { | |
en: "Good morining", | |
de: "dutch", | |
sp: "spnish" | |
}; | |
log d; | |
log a; | |
log a1; | |
log m1; | |
function guessTheType(v: variant) : void { | |
if (typeof v == "string"){ | |
log "v is a string"; | |
} else { | |
log "v is not a string"; | |
} | |
} | |
var type: string; | |
type = "adsf"; | |
guessTheType(type); | |
function shiftOrReturnEmptyString(args: string[]) : string { | |
if (args.length > 0){ | |
return args.shift(); | |
} else { | |
return ""; | |
} | |
} | |
var someString = shiftOrReturnEmptyString(a); | |
log someString; | |
var pt = new Point(); | |
pt.set(10); | |
pt.print(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment