Professional Documents
Culture Documents
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script>
// Percabangan
if (isMahasiswa) {
} else {
// Looping
// Fungsi
function hitungLuasPersegi(sisi) {
let sisiPersegi = 4;
+ luasPersegi);
// Objek Sederhana
let orang = {
nama: "Alice",
umur: 30,
pekerjaan: "Guru"
};
// Permainan Acak
</script>
</body>
</html>
GAMES TEBAK ANGKA
<script>
function checkGuess(guess) {
} else {
while (true) {
100:"));
if (isNaN(playerGuess)) {
continue;
}
// Check the player's guess and give feedback
alert(guessFeedback);
break;
</script>
TEBAK ANGKA WITH SCORE
<!DOCTYPE html>
<html>
<head>
<style>
#gameCanvas {
</style>
</head>
<body>
<p id="resultMessage"></p>
<script>
let attempts = 0;
function checkGuess() {
attempts++;
guessButton.disabled = true;
score -= 10;
score -= 10;
${targetNumber}.`;
guessButton.disabled = true;
</script>
</body>
</html>