Function that modifies function argument and persists

This question already has an answer here:

  • Javascript by reference vs. by value [duplicate] 4 answers

  • No , it can't be done.

    From the TypeScript specification:

    TypeScript is a syntactic sugar for JavaScript. TypeScript syntax is a superset of ECMAScript 2015 (ES2015) syntax. Every JavaScript program is also a TypeScript program.

    TypeScript is a superset of JavaScript and in JavaScript, arguments can not be passed by reference (well, except objects).

    链接地址: http://www.djcxy.com/p/20988.html

    上一篇: JavaScript数组分配问题

    下一篇: 修改函数参数并保持的函数