JS
challenger
Home
Intermediate JavaScript
classes
Add a Static Method
Add a Static Method
Add a static method
square
to the class
MathUtil
. It should take a number
n
and return
n * n
. Call it as
MathUtil.square(5)
.
Premium
reset
function greet(name) { return `Hello, ${name}!`; } console.log(greet("Erik"));
JavaScript
Run Code
Console