typescript-tutorial icon indicating copy to clipboard operation
typescript-tutorial copied to clipboard

Hello TypeScript

Open xcatliu opened this issue 4 years ago • 12 comments

https://ts.xcatliu.com/introduction/hello-typescript.html

xcatliu avatar Jun 08 '20 12:06 xcatliu

老顶了。。

Gen1usG avatar Oct 09 '20 09:10 Gen1usG

那么这个 hello.js 怎么执行呢?

AlaxLee avatar Oct 25 '20 11:10 AlaxLee

@AlaxLee node hello.js

xcatliu avatar Oct 25 '20 12:10 xcatliu

@AlaxLee 那么这个 hello.js 怎么执行呢?

这个同志问的好

barry1102 avatar Nov 13 '20 10:11 barry1102

这个文档是基于ts4.0吗

lywq9296 avatar Nov 22 '20 04:11 lywq9296

全局安装 npm install -g typescript;然后就可以用ts-node xxx.ts来运行;也可以在vscode安装插件Codd Runner,这个就比较简单了,右键Run Code 即可。

Espero1995 avatar Dec 06 '20 02:12 Espero1995

@AlaxLee 那么这个 hello.js 怎么执行呢? 好家伙 我踏马直接好家伙

eighteensss avatar Dec 08 '20 07:12 eighteensss

@AlaxLee 那么这个 hello.js 怎么执行呢?

用意念执行即可...

baiwenhao avatar Dec 28 '20 03:12 baiwenhao

@AlaxLee 那么这个 hello.js 怎么执行呢?

这个钩也太直了

realheng avatar Jan 08 '21 05:01 realheng

@AlaxLee 那么这个 hello.js 怎么执行呢?

老兄,不要怕,我也不会

wg39711 avatar Jan 26 '21 03:01 wg39711

// hello.ts
function sayHello(person: String) {
  return `Hello ${person}`;
}

let randomIndex = Math.floor(Math.random() * 3);

let possibleArr = ['Mike', 123, { name: 'Mike' }];
// let possibleArr = ['Mike', undefined, null];

// 终究还是能骗过检查/编译是么 ? 
// let possibleArr = ['Mike'];

let person = possibleArr[randomIndex];
console.log(sayHello(person));

好家伙 !

mike652638 avatar Jan 29 '21 09:01 mike652638

@AlaxLee 那么这个 hello.js 怎么执行呢?

不用执行,看看就行

ClishWang avatar Feb 23 '21 09:02 ClishWang