4geeksacademy / javascript-beginner-exercises-tutorial Goto Github PK
View Code? Open in Web Editor NEWLearn to Code: Interactive and Auto-graded Tutorials In Javascript
License: Other
Learn to Code: Interactive and Auto-graded Tutorials In Javascript
License: Other
The file test.js is empty.
When I am using learnpack during the JS exercises, when I try to test my code it says "internal error."
when I press test to see if it is correct it shows unexpected error
It will only work if you input 40, but the number itself shouldn't matter, only the logic behind it.
al llegar a un cierto punto del learn pack me da error y no me sigue cargando
There appears to be a bug in the tests for excercise 20. The potential solution (below) fails with :
x (fail) 2. console.log() function should be called 10 times
x (fail) 3. console.log() function should be called with a string
even though it does call console.log
10 times with a string (the generated colors):
//get random integer between (inclusive of) min and max
function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max+1);
return Math.floor(Math.random() * (max - min) + min);
}
function getColor(colorNumber=0)
{
//make sure parameter is a number and not a string by converting the value to int:
colorNumber = parseInt(colorNumber);
switch(colorNumber){
case 1: return "red";
break;
case 2: return "yellow";
break;
case 3: return "blue";
break;
case 4: return "green";
break;
default: return "black";
break;
}
}
function getAllStudentColors(){
for(let i=0; i<10; i++){
let studentColor = getColor(getRandomInt(1,4));
console.log(studentColor);
}
}
//call the function below with the number of students in the class and print on the console
getAllStudentColors();
The test is looking for Hello World in the console instead testing the switch statement.
When I hit the test button an error message comes up and dosent not allow me to do so
The exercise has a line saying "Change the code below:", so it's impossible to change it without breaking the rules
Exercises 12 and 13 always fail because prompt is not defined.
The error is:
ReferenceError: prompt is not defined
> 1 | let guests = prompt('How many people are coming to your wedding?');
| ^
2 |
3 | function getPrice(guests){
4 | let cost = 0;
at exercises/12-How_much_the_wedding_costs/app.js:1:1039
at Object.<anonymous> (exercises/12-How_much_the_wedding_costs/app.js:110:4)
at Object.load (../../home/node/.local/share/@learnpack/learnpack/node_modules/rewire/lib/moduleEnv.js:55:18)
at internalRewire (../../home/node/.local/share/@learnpack/learnpack/node_modules/rewire/lib/rewire.js:49:15)
at rewire (../../home/node/.local/share/@learnpack/learnpack/node_modules/rewire/lib/index.js:11:12)
at Object.rewire (exercises/12-How_much_the_wedding_costs/tests.js:12:17)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.