Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
From what little you've shared, their material does seem to be rather low quality.
-
cloudsxvx594y@SortOfTested 1. Your function should include at least one switch
2. Your function must accept any possible combination of inputs
3. If the inputs are valid, it should return an array with 2 variables inside of it: value3, and label3. For example:
return [5,"minutes"];
The exact label you choose to return for label3 ("minutes" for example) is up to you.
4. If the inputs are invalid or impossible, it should return false. Here are examples of impossible and invalid inputs:
timeAdder(5,"hour",5,"minutes") // This is impossible because "hour" is singular and 5 is plural
timeAdder(false,false,5,"minutes") // This is invalid because the first 2 arguments are not the correct types
timeAdder({},"days",5,"minutes") // This is invalid because the first argument is the wrong type -
cloudsxvx594y@SortOfTested const expr = 'Papayas';
switch (expr) {
case 'Oranges':
console.log('Oranges are $0.59 a pound.');
break;
case 'Mangoes':
case 'Papayas':
console.log('Mangoes and papayas are $2.79 a pound.');
// expected output: "Mangoes and papayas are $2.79 a pound."
break;
default:
console.log(`Sorry, we are out of ${expr}.`);
}
that's pretty much the example I got. -
@cloudsxvx
That's a pretty stupid exercise. Especially the part where the equate grammar to value. Pretty engrish. You also generally shouldn't have multiple return types from a single function.
Any chance you could get your money back on the course? They're not teaching you anything useful. -
cloudsxvx594y@SortOfTested doubt it. I felt as if teamtreehouse was pretty good but my subscription ran out and I don't feel like resubscribing (I had an injury and I've been out of work, so I've dove into trying to learn as much as I can in the process) I just don't really know any good free ways of getting adequate.
-
@cloudsxvx
Not gonna lie, I just read books and docs and write code based on what I read.
Related Rants
this is my first actual rant. I am trying to learn es6 right now and have encountered switch statements for the first time. after a 26 minute video explaining how to do switch statements (which is literally just the same kind of information on them that you can get from w3 or mdn I am given a large task with no practice to create a switch function that hold four values two values containing positive integers and two values accepting strings. then I have to be able to pass days and minutes through it.
an example solution after input would be:
addTime(1,"hour",3,"minutes")
I feel like this is too complicated with 26 minutes of information and no practice exercises to prepare for that.
-end rant
rant
es6
pirple.com