This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Form Validation</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="shortcut icon" href="data:image/x-icon;" type="image/x-icon"> | |
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" | |
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable no-multiple-empty-lines */ | |
/* eslint-disable prefer-const */ | |
/* eslint-disable import/extensions */ | |
import runChallenges from "../spec/inbox_examiner.js"; | |
const hasNewMessage = () => { | |
// TODO: return true with a probability of 20%. | |
return Math.random() < 0.2; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TODO: write your code here | |
const moveForward = (player) => { | |
const wagon = document.querySelector(`#player${player}-race .active`); | |
if (wagon.nextElementSibling) { | |
wagon.nextElementSibling.classList.add('active'); | |
wagon.classList.remove('active'); | |
} else { | |
alert(`Player ${player} wins! Play again?`); | |
window.location.reload(); | |
} |
OlderNewer