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 trialChampe Chilufya
1,349 PointsRerun code in chrome?
I was wondering if there a way to run the code i have put into chrome from the start - I normally input it in steps but as soon I press enter it runs the code. for example "let name =prompt (what is your name" - I would like to store this and use it later on and then test the entire code after - but chrome runs it first line as soon as I press enter
2 Answers
Cleston p
3,314 PointsYou could put it in a function and then when you need it call it
Cleston p
3,314 PointsIf you press Shift+Enter you go to a new line
Champe Chilufya
1,349 PointsThank you that helps... but doesn't that mean there isn't a way to run the code again from the beginning once it has run once ?
Champe Chilufya
1,349 PointsChampe Chilufya
1,349 PointsBrilliant I think that would work to be honest thanks