Same lesson, syntax question:
console.log(Math.floor(Math.random()*100))) VS console.log(Math.floorMath.random()*100))
The first is not accepted by codecademy, but is it acceptable syntax in Java? It did log a random whole number.
Same lesson, syntax question:
console.log(Math.floor(Math.random()*100))) VS console.log(Math.floorMath.random()*100))
The first is not accepted by codecademy, but is it acceptable syntax in Java? It did log a random whole number.
Consider,
function foo(bar) {
return bar * 2;
}
function faz(baz) {
return baz * 3;
}
console.log(foo(faz(7)));
What will the above log out?
Thanks mtf, but I was asking specifically about the use of parentheses preceding a function name. It looks like Java doesn’t mind, but the lesson rejected my initial answer.
If you were, then point it out, I don’t see any of that ilk.
Bear in mind that we cannot see your code. You must post it here (formatted, one would hope). The link serves a valuable purpose, though. We can see our code, and be able to test yours in the lesson interface with that SCT context.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.