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

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -