PARAMETERIZED FUNCTION

时间:2017-08-19 03:29:37

标签: angularjs angular

我是Angular的新手。我正在尝试编写一个函数。这没有参数编译。但是它给出了错误的论据。

Play.ts中的代码

function printperson(name:string, age:number)
{
console.log('Name: ${name} age: ${age}')
}
printperson("Billy", 8);

执行命令

node play.ts

错误

  

(function(exports,require,module,__ filename,__ dirname){
  function printperson(name:string,age:number)
  ^ SyntaxError:意外的令牌:在createScript(vm.js:53:10)
  在Module._compile的Object.runInThisContext(vm.js:95:10)   (module.js:543:28)在Object.Module._extensions..js   (module.js:580:10)在Module.load(module.js:488:32)at   在Function.Module._load中的tryModuleLoad(module.js:447:12)   (module.rs:439:3)在运行时的Module.runMain(module.js:605:10)   (bootstrap_node.js:42:7)启动时(bootstrap_node.js:147:9)

0 个答案:

没有答案