Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialmsdsmd sm,dfsadf
1,124 PointsI do not know why this won't work. It is very easy to read and four line of code.
<script>
/*Why Nothing appears in my browser? I think I am allowed to
use a method on a property because value.upperCase will work.*/
let num='34534234'
alert(num.length.JSON.parse('2'))
/*Why the second line of code works if the first line of code won't work?*/
h1.classList.add()
.
</script>
1 Answer
Shumin Zhou
Full Stack JavaScript Techdegree Graduate 32,510 PointsHi, there, first of all JSON.parse() method is going to convert JSON data into a javaScript object, in this case, variable num is a not JSON data. so it will not going to return anything
secondly, length property is going to return the number of character, in this case is number 8. number is not a JSON data JSON.parse will not going to return anything either.
Roscoe Coney
13,124 PointsRoscoe Coney
13,124 Pointslooking at this quickly what happens when you add... right before </script>
console.log("this is my H1" + h1)