Ask coding questions

← Back to all posts
1
help please
nyiaevans (0)

https://repl.it/student/submissions/7177337

On the next line create a variable called 'length' and using the length property assign the new variable to the length of str
let name = "str"

name .(length);

// Please write your answer in the line above.
return length;
}

function exerciseFour(num1){
// In this exercise, you will be given a variable, it will be called: num1
// On the next line create a variable called 'rounded'. Call the Math global object's round method, passing it num1, and assign it to the rounded variable.
Math.rounded(num1);

// Please write your answer in the line above.
return rounded;
}

need help with the last two questions on my test

Answered by vedprad1 (433) [earned 5 cycles]
View Answer
Commentshotnewtop
1
vedprad1 (433)

length is a property, not a method. You are supposed to write this:

var length = str.length;

For the second one, you used the wrong method, and also you did not assign Math.rounded(num1) to anything.
Do the following:

var rounded = Math.round(num1);
return rounded;

If this answers your question, please check the checkmark on the left side of this message. Thanks and Good Luck!

1
nyiaevans (0)

Thank you for your help this is all new to me