Ask coding questions

← Back to all posts
2
JS Newbie..Help
SeanChadwick (1)

function exerciseThree(str){
// In this exercise, you will be given a variable, it will be called: str
// On the next line create a variable called 'length' and using the length property assign the new variable to the length of str

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

Can somebody help me please and thx you

Commentshotnewtop
2
theangryepicbanana (657)

We will not do it for you. If you don't understand part of it, then explain what it is so we can actually help you

1
SeanChadwick (1)

@theangryepicbanana

sorry so my answer was...

var length = 'Something';
length.length;

When i ran tests it said
'length' should be the length of str

But i don't understand how to assign it to str

1
theangryepicbanana (657)

@SeanChadwick well if you do var length = 'Something', that doesn't actually get the length of str. str is a variable that currently equals a string. knowing that, how would you just get the length of str?

1
JustARatherRidi (185)

@SeanChadwick Yup, you got it. Did you pass the tests?

1
abc3354 (92)

@SeanChadwick If @theangryepicbanana helped you, please mark his post as the answer ;)

0
Steven_The_GuyT (197)

@abc3354 @SeanChadwick or just mark mine! xd (don't do it)