FAQ: Code Challenges: JavaScript Fundamentals - Fix The Broken Code


#1

This community-built FAQ covers the “Fix The Broken Code” exercise from the lesson “Code Challenges: JavaScript Fundamentals”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development

FAQs on the exercise Fix The Broken Code

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!


#2

Although my code below seems valid, I’m trying to use console.log() to figure out what each individual die actually is (as suggested in Hint); however, when I do that, I get “ReferenceError: die1 is not defined at Object.”. Any ideas why?


#3

I suppose that something is wrong in test.js file.


#4

hello !!! I wanted to ask a question…Why we are multiplying by 6 and then adding 1 ? why we are not multiplying by 7 straight away?


#5

Sorry, i think I found out by myself. so, if the random number will be floored to 0 - it is not existing on the dice. By adding 1 we make it real. Do i think correct ??