Changes the example function from having a name of "throw" to having a name of "toss"
Motivation and Context
"throw" is a reserved word in JavaScript, so trying to create a function or a variable with the name "throw" will lead to some errors.
Fixes this issue
How Has This Been Tested?
To verify that "throw" was not a valid name for a function or variable, I created a plain JavaScript file with following code:
const throw = () =>"hello"
throw()
And upon running the code with node, I received this error:
In addition to the errors in my terminal, the VSCode JavaScript/TypeScript plugin also warned me with this error: 'throw' is not allowed as a variable declaration name.
Description
Changes the example function from having a name of "throw" to having a name of "toss"
Motivation and Context
"throw" is a reserved word in JavaScript, so trying to create a function or a variable with the name "throw" will lead to some errors. Fixes this issue
How Has This Been Tested?
To verify that "throw" was not a valid name for a function or variable, I created a plain JavaScript file with following code:
And upon running the code with node, I received this error:
In addition to the errors in my terminal, the VSCode JavaScript/TypeScript plugin also warned me with this error:
'throw' is not allowed as a variable declaration name.