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
| /* | |
| 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; | |
| } |
| <!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; |
| <!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; |
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.
| { | |
| "version": 2, | |
| "projects": { | |
| "rickandroll": { | |
| "root": "apps/rickandroll", | |
| "sourceRoot": "apps/rickandroll/src", | |
| "projectType": "application", | |
| "targets": { | |
| "build": { | |
| "executor": "@nrwl/node:build", |
| server { | |
| listen 80; | |
| listen [::]:80; | |
| root /var/www/{domain}/html; | |
| index index.html index.htm index.nginx-debian.html; | |
| server_name {domain} www.{domain}; | |
| location /api/ { |
| import React, { useState, useEffect } from 'react'; | |
| import { Search } from './Search'; | |
| import { Video } from './Video'; | |
| export function App() { | |
| const [videos, setVideos] = useState([]); | |
| const [currentChannelId, setCurrentChannelId] = useState(); | |
| const [channelName, setChannelName] = useState(); | |
| const [searchError, setSearchError] = useState(); // Create searchError state |
| body { | |
| font-family: "Commissioner", sans-serif; | |
| font: "Commissioner", sans-serif; | |
| } | |
| .app-container { | |
| padding: 50px; | |
| } | |
| .search { |