The purpose of this server is to help you learn about all things code, programming, and web development as well as connect with others that are doing the same.
The current admins are:
- Dave Gray (owner)
// Class with methods | |
class Pizza { | |
constructor(size, crust, sauce) { | |
this.size = size; | |
this.crust = crust; | |
this.sauce = sauce; | |
this.toppings = []; | |
} | |
prepare() { console.log('Preparing...') } | |
bake() { console.log('Baking...') } |
// A memoize decorator function | |
// that is capable of handling multiple parameters | |
export const memoize = (fn) => { | |
const cache = {}; | |
return (...args) => { | |
if (JSON.stringify(args) in cache) { | |
// if you want to verify result comes from cache | |
console.log(cache); | |
return cache[JSON.stringify(args)]; |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>My Page</title> | |
<style> | |
* { | |
margin: 0; | |
padding: 0; |
* { | |
margin: 0; | |
padding: 0; | |
-webkit-box-sizing: border-box; | |
box-sizing: border-box; | |
} | |
html { | |
font-family: Arial, Helvetica, sans-serif; | |
font-size: 16px; |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>My Page</title> | |
<link rel="stylesheet" href="css/js_chapter_22_css.css" /> | |
<script defer src="js/main.js"></script> | |
</head> |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Output Element</title> | |
</head> | |
<body> |