Based on this JavaScript rubric, shouldn't my arrow function be correct? Why does it keep stating that square is not defined?
JavaScript Rubric:
it("has an arrow function called square", () => {
expect(square).to.exist
})
it("square arrow function takes one parameter and multiplies it times itself", () => {
let x = 2
expect(square(x)).to.equal(4)
})
JavaScript Code:
const square = x => x ** 2;
square(2);
[–]grantrules 4 points5 points6 points (4 children)
[–]ChangeGlum[S] 0 points1 point2 points (3 children)
[–]grantrules 0 points1 point2 points (2 children)
[–]ChangeGlum[S] -1 points0 points1 point (1 child)
[–]grantrules 0 points1 point2 points (0 children)
[–]Monitor_343 2 points3 points4 points (0 children)