-
Posts
1,640 -
Joined
-
Last visited
Content Type
Forums
Status Updates
Blogs
Events
Gallery
Downloads
Store Home
Everything posted by c0d0ps
-
How to convert if to switch statement in JavaScript? (beginner JavaScript)
c0d0ps replied to c0d0ps's topic in Programming
The exercise was to use a switch statement not if else statements but yes I am more comfortable with if else statements from my high school days. I am still new to the whole switch thing. This exercise is part of the mozilla course of javascript called conditionals 3 I think you missed the part where I added break; but yes it was needed. The code wasn't read properly by the computer without it. I will try to remember that. I appreciate pedantics as much as anyone (even if I don't know much about programming) but I think you're exaggerating about the whole abusing. Coding in bliss is not abuse it is me taking the stairs and falling down and hurting my ankles. Not worse than that. -
How to convert if to switch statement in JavaScript? (beginner JavaScript)
c0d0ps replied to c0d0ps's topic in Programming
Thank you that worked great, except for machineActive = false I get this error code, = true still works like it should though and I don't know why Summarizing: For this specific exercise it is better to define response because of the pre stated paragraph. -
How to convert if to switch statement in JavaScript? (beginner JavaScript)
c0d0ps replied to c0d0ps's topic in Programming
Hi thanks for answer, as noted in my (second) previous comment even on machineActive=true it shows Your Score is 75 and not the console log for case score >= 70 && score < 89: console.log("That's a great score, you really know your stuff."); break; screenshot -
How to convert if to switch statement in JavaScript? (beginner JavaScript)
c0d0ps replied to c0d0ps's topic in Programming
Thank you This is the code after fixing the no break problems and exchanging response to console.log(); Only problem is nothing shows up besides "Your score is 75." -
How to convert if to switch statement in JavaScript? (beginner JavaScript)
c0d0ps replied to c0d0ps's topic in Programming
So this is what I came up with thanks to the stack overflow linked above. Unfortunately it says "machine is not on" even when change let machineActive = false; to true -
How to convert if to switch statement in JavaScript? (beginner JavaScript)
c0d0ps replied to c0d0ps's topic in Programming
Conditionals 3 Conditionals 2 Update: TLDR the goal is to convert if else statements to a switch version of the statement (like noted in my under "JavaScript" headline). Not necessarily using an if else statement (which I tried to do) in a switch statement. I will work on better placing though thank you. -
How to convert if to switch statement in JavaScript? (beginner JavaScript)
c0d0ps replied to c0d0ps's topic in Programming
Test your skills: Conditionals - Learn web development | MDN (mozilla.org) I am doing the mozilla online course - javascript exercise -
Hi I'm using a .html and .js file Languages: HTML, CSS, JavaScript Level: Beginner Problem: I'm guessing switch statements don't work with if else statements? Updated to bring more clarity To underline the point of the exercise here: the goal is to convert if else statements to a switch version of the statement (like noted in my under "JavaScript" headline). Not necessarily using an if else statement (which I tried to do) in a switch statement. JavaScript See updated code further down if-else Code from last exercise that i'm converting to a switch statement Updated code:
-
Hi I forgot to everything under var newStory = storyText; var xItem = randomValueFromArray(insertX); var yItem = randomValueFromArray(insertY); var zItem = randomValueFromArray(insertZ); when I updated my comment I managed to fix it, thank you
- 4 replies
-
- beginner programmer
- javascript html css
-
(and 1 more)
Tagged with:
-
NVM it works, thank you JavaScript
- 4 replies
-
- beginner programmer
- javascript html css
-
(and 1 more)
Tagged with:
-
Hi I'm using a .html and .js file Languages: HTML, CSS, JavaScript Level: Beginner Problem: Unable to loop through JavaScript program more than once (aka change custom name a second time or changing from us to uk) I managed to fix all my problems to get the program to work but I do not know why it only works one time.. Short info about the program: It generates a short story where Bob is replaced by your custom name and it can translate fahrenheit and pounds to celsius and kg If you would like to make this program yourself just google Mozilla Javascript (the course) silly story generator (the assignment to test your beginner skills) or something similar. Html CSS JavaScript
- 4 replies
-
- beginner programmer
- javascript html css
-
(and 1 more)
Tagged with:
-
Update: I removed the calling and then I got stuck on what to do next. How do use input type="button" in javascript? is it like Or something else? the Mozilla website didn't show an example of how to do this. JavaScript HTML <input type="reset" value="Börja Om" onclick="Reset()"> I will be done with CSS soon then I can learn more about JavaScript which seems to be the most fun part about building a website..
-
Hiya again, I changed minimum time from 10 to 07 and max time from 15 to 18 and then my placeholder disappeared. I am not sure why the placeholder disappeared when all I did was change the time to 3h earlier..? Example of problem - " should be month/day/year 07:-- " JavaScript - Changed min and max on both when I start and end work HTML
-
I actually just found this out. Thanks, this works great - It also works with ID! CSS
- 4 replies
-
- beginner programmer
- front end developers
-
(and 1 more)
Tagged with:
-
Hi, thanks for answer. This did not work. HTML CSS Fail.jpg I'll try to use datalist id instead I suppose.
- 4 replies
-
- beginner programmer
- front end developers
-
(and 1 more)
Tagged with:
-
Hi I'm using a .html file Languages: HTML, CSS Level: Beginner Problem: Trying to style my dropdown-form yellow aka same as password Problem.jpg Correct.jpg HTML CSS
- 4 replies
-
- beginner programmer
- front end developers
-
(and 1 more)
Tagged with:
-
My brand new Ryzen 9 5900X is underperforming in games
c0d0ps replied to keshavcolonel's topic in Troubleshooting
Any updates? What did you do to fix the problem? -
That fixed it thank you. all.js seemed to have the right code. I'll remember to ignore crosssorigin for local files vs remote files.
- 6 replies
-
- beginner programmer
- html5
-
(and 2 more)
Tagged with:
-
External Javascript HTML Screenshot of other JavaScript files available in the zip file: Should I do something more? Thanks for reply.
- 6 replies
-
- beginner programmer
- html5
-
(and 2 more)
Tagged with: