Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Това работи:
- const generateTarget = () => {
- console.log(Math.floor(Math.random() * 10));
- }
- generateTarget();
- =======================
- А това не знам как да го накарам да работи:
- const generateTarget = () => {
- return Math.floor(Math.random() * 10);
- }
- ========================
- и този return не ми е ясен:
- const compareGuesses = (humanGuess, computerGuess, targetGuess) => {
- const humanDifference = Math.abs(targetGuess - humanGuess)
- const computerDifference = Math.abs(targetGuess - computerGuess)
- return humanDifference <= computerDifference;
- }
- =======================
- Какво точно прави тази функция? Явно е написана твърде съкратено:
- const advanceRound = () => currentRoundNumber++;
- =======================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement