xxxxxxxxxx
Try this one:
https://www.typescriptlang.org/play/
xxxxxxxxxx
npm install -g typescript
tsc --init #reate a tsconfig.json file
tsc --watch # transpile on change in current directory (watch changes)
# in your package.json "compilets-tojs": "npx tsc --project ./",
# you can rename "compilets-tojs" to any shorter name
npm run compilets-tojs
xxxxxxxxxx
1234567891011121314
const message:string = "hello world!";console.log(message);var alist = ["a","b"];var blist = ["c","d"];var clist = [];alist.forEach(element =>{ blist.forEach(group => { var temp = element; console.log(temp); temp = temp + group; clist.push(temp) });});console.log(clist);