ecmascript 6 - typesafe rest parameter in ES6 -


do have way make rest parameter typesafe. trying following code throwing error,

<script>         function addn(name, ...numarray:number[]){         let result = 0;         numarray.foreach((n) => result += n);         return result;       }       document.write(addn('abc', 2,33,6));      </script> 


Comments

Popular posts from this blog

cookies - Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www) -

angular - password and confirm password field validation angular2 reactive forms -

php - Permission denied. Laravel linux server -