From 741179121028c771334ef1791666555a0f3943b5 Mon Sep 17 00:00:00 2001 From: Brett Nelson Date: Mon, 24 Oct 2016 00:33:39 -0500 Subject: [PATCH] add 08-typescript --- 08-typescript/test.js | 10 ++++++++++ 08-typescript/test.ts | 15 +++++++++++++++ 08-typescript/test01.js | 9 +++++++++ 08-typescript/test01.ts | 8 ++++++++ 08-typescript/tsconfig.json | 3 +++ 5 files changed, 45 insertions(+) create mode 100644 08-typescript/test.js create mode 100644 08-typescript/test.ts create mode 100644 08-typescript/test01.js create mode 100644 08-typescript/test01.ts create mode 100644 08-typescript/tsconfig.json diff --git a/08-typescript/test.js b/08-typescript/test.js new file mode 100644 index 0000000..6258110 --- /dev/null +++ b/08-typescript/test.js @@ -0,0 +1,10 @@ +var whatIsCool = function (word) { return (word + " is cool!"); }; +var MyCoolClass = (function () { + function MyCoolClass() { + this.isCool = true; + this.isPurple = 'maybe'; + } + return MyCoolClass; +}()); +var coolPhrase = whatIsCool('TypeScript'); +console.log(coolPhrase); diff --git a/08-typescript/test.ts b/08-typescript/test.ts new file mode 100644 index 0000000..a7ed78d --- /dev/null +++ b/08-typescript/test.ts @@ -0,0 +1,15 @@ +var whatIsCool = word => `${word} is cool!`; + +class MyCoolClass { + isCool; + isPurple; + constructor() { + this.isCool = true; + this.isPurple = 'maybe'; + } + +} + +var coolPhrase = whatIsCool('TypeScript'); + +console.log(coolPhrase); \ No newline at end of file diff --git a/08-typescript/test01.js b/08-typescript/test01.js new file mode 100644 index 0000000..cc71de5 --- /dev/null +++ b/08-typescript/test01.js @@ -0,0 +1,9 @@ +var test2 = (function () { + function test2() { + this.hello = 'hello'; + } + test2.prototype.say = function () { + return this.hello; + }; + return test2; +}()); diff --git a/08-typescript/test01.ts b/08-typescript/test01.ts new file mode 100644 index 0000000..3ace1f0 --- /dev/null +++ b/08-typescript/test01.ts @@ -0,0 +1,8 @@ +class test2 { + hello = 'hello' + + say() { + return this.hello; + } + +} \ No newline at end of file diff --git a/08-typescript/tsconfig.json b/08-typescript/tsconfig.json new file mode 100644 index 0000000..162c7d9 --- /dev/null +++ b/08-typescript/tsconfig.json @@ -0,0 +1,3 @@ +{ + "compileOnSave": true +} \ No newline at end of file