Aktywne Wpisy
xena_x +1
Co w XXI wieku może zaoferować przeciętny mężczyzna kobiecie?
Pomijam dobra materialne i finansowe, s*ks, dziecko.
Czy przeciętny polski mężczyzna ma cokolwiek kobiecie do zaoferowania?
- poczucie bezpieczeństwa
- wsparcie
Pomijam dobra materialne i finansowe, s*ks, dziecko.
Czy przeciętny polski mężczyzna ma cokolwiek kobiecie do zaoferowania?
- poczucie bezpieczeństwa
- wsparcie
![xena_x - Co w XXI wieku może zaoferować przeciętny mężczyzna kobiecie?
Pomijam dobra ...](https://wykop.pl/cdn/c3201142/8763b4706aca2ac6e4720178683cb0d91117bd90666c7238839fb477a8cca057,w150.jpg)
źródło: Screenshot_20240703_094116_TikTok
Pobierz![Onaaa20](https://wykop.pl/cdn/c3397992/Onaaa20_6hI6YKwIs1,q60.jpg)
Onaaa20 +38
Its over…
#rozowepaski #niebieskiepaski #pieklokobiet #hipergamia #blackpill #p0lka #tinder #zwiazki #przegryw
#rozowepaski #niebieskiepaski #pieklokobiet #hipergamia #blackpill #p0lka #tinder #zwiazki #przegryw
![Onaaa20 - Its over…
#rozowepaski #niebieskiepaski #pieklokobiet #hipergamia #blackpil...](https://wykop.pl/cdn/c3201142/75914cdae4ccc8d099cc0f6a641960e986ab84eca4db350c033ffa3cad600eb5,w150.jpg?author=Onaaa20&auth=3a794849e65d6e0f81eec389eead6d10)
źródło: IMG_4981
Pobierz
JavaScript has built in functions, which help us do everyday things. We'll learn more about functions later in the course, so don't worry about understanding what they are right now.
Sometimes it's necessary to generate a random number within a program. We can do that with this code:
Math.random();
This code will return a random number between 0 and 1. JavaScript will generate a random number for us with this code.
To generate a random number between 0 and 50, we could multiply this result by 50, like so:
Math.random() * 50;
The problem with this is that the answer will most likely be a decimal. Luckily, JavaScript has our back with another built in function called Math.floor. Math.floor will take a decimal number, and round down to the nearest whole number. It is used like this:
Math.floor(Math.random() * 50);
In this case:
Math.random will generate a random number between 0 and 1.
We then multiplied that number by 50, so now we have a number between 0 and 50.
Then, Math.floor will round the number down to the nearest whole number.
Let's utilize these two methods to generate a random number between 0 and 100.
I mam zrobić to:
Inside of a console.log, create a random number with Math.random, then multiply it by 100.
If you run the program few times, you'll see random numbers in the console.
Piszę tak:
console.log(Math.floor(Math.random() * 100));
Gdzie robię błąd?
#naukaprogramowania #codeacademy
@wolfram11: U mnie dziala