your answer here
your answer here
your answer here
your answer here
your answer here
your answer here
your answer here
your answer here
your answer here
Consider: var a = 1;
Write the code to:
// your code here
// your code here
Code challenge:
Ask the user's name with a prompt message "Please, type your username"
and store it in a variable username
, then log the value in the console.
Solution:
// your code here
JavaScript has both u___ and b___ operators, and one special t___ operator
your answer here
Name the types of operators you know, and give some basic examples.
your answer here
your answer here
your answer here
your answer here
your answer here
your answer here
your answer here
your answer here
your answer here
your answer here
var amount = 100;
{
amount = amount * 2;
console.log(amount)
}
your answer here
24. Write a block of code to validate if a variable number
is less than 10
to log one digit
, log two digits
otherwise.
Solution:
// your code here
while
solution:
// your code here
do-while
solution:
// your code here
for
solution:
// your code here
your answer here
your answer here
Solution:
// your code here
your answer here
Consider:
function outer() {
var a = 1;
function inner() {
var b = 2;
}
inner();
}
outer();
your answer here
your answer here
1.1 Create a function calculateAreaOfACircle
that receives radius
as parameter. Use a constant PI
equal to 3.14159
. Avoid the temptation of using the Math
library.
Solution:
// create the constat PI here
// create your function here
// Do NOT touch this code.
console.log('Expect area of a circle with radius = "3" to be "28.27431" ->', calculateAreaOfACircle(3) == 28.27431)