Skip to content

Instantly share code, notes, and snippets.

@codebubb
codebubb / js-exercises-01.md
Last active October 23, 2023 08:18
JavaScript Exercises: Exercise 01

JavaScript Exercises: Exercise 01

Scrabble Score

Scrabble is a word game where players score points for making words on a tiled board.

The amount a player scores for a word depends on what letters they use in their word.

Your goal for this exercise is to work out the Scrabble score for a player's word.

@codebubb
codebubb / js-exercises-02.md
Created October 23, 2023 10:15
JavaScript Exercise 02: Valid Zip Codes

JavaScript Exercises: Exercise 02

Valid Zip Codes

Write some code that validates a Zip code.

The rules for a valid zip code are as follows:

  • Contain only numeric values (no non-digits allowed).
  • Has no spaces
@codebubb
codebubb / index.html
Created November 1, 2023 10:21
How To Fix the JSON parse error
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JSON.parse Error</title>
<style>
* {
box-sizing: border-box;
@codebubb
codebubb / random-number.html
Last active November 1, 2023 14:23
Random number generator in JavaScript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JSON.parse Error</title>
<style>
* {
box-sizing: border-box;
@codebubb
codebubb / functions.js
Created November 1, 2023 16:52
6 Ways To Write Functions in JavaScript
/*
1. With a Function declaration
Function is hoisted so can be used before it is declared
*/
console.log(add(2, 2));
function add(n1, n2) {
return n1 + n2;
}