Last revised Feb 1, 2024, 3:00 pm
<!DOCTYPE html> <html> <head> <title> <link> <style> <script> <meta> <body> <div> <span> <pre> <br> <hr> <h1> <h2> <p> <ul> <ol> <li> <table> <tr> <th> <td> <input> <label> <button> <img> <a>
color background-color font-family font-size font-weight font-style font width height padding margin border-style border-color border-width
red lime blue maroon green navy yellow aqua turquoise olive teal purple black white gray silver pastel red (pink) pastel green pastel blue
font padding margin border
else false for function if let return true typeof var
boolean number object string undefined
Arithmetic: + - * / ** % Increment: ++ -- Comparison: == === < <= > >= != !== Logical: && || Assignment: = += -= *= /= Miscellaneous: . [ ] ( ) { } typeof
if..else if..else if..else whilefor (traditional and modern)
foreach reverse slice sort toString
charAt indexOf lastIndexOf repeat slice toLowerCase toUpperCase trim
abs ceil floor max min random round
var name = "Larry", amt = "$245.81"; var s = `${name} owes me $${amt}.`;
JSON.stringify JSON.parse Example: kids = '[ {"name": "Alice", "age" : 11}, {"name": "Bob", "age" : 9} ]';
Package | Property | Methods |
---|---|---|
http | createServer | |
http-status-codes | StatusCodes | |
fs | readFile writeFile |
Object | Properties | Methods |
---|---|---|
app | listen | |
request | headers method url | |
response | writeHead write end |
The app object is created like this:
var app = http.createServer(callbackFunction);The callback function is often passed in as an anonymous function.