Skip to content

Instantly share code, notes, and snippets.

@Samjin
Samjin / express4-response-methods.js
Last active October 6, 2022 07:02 — forked from prof3ssorSt3v3/app.js
Express Sending Responses of various types from YouTube tutorial.
"use strict";
// https://expressjs.com/en/4x/api.html#res
const express = require("express");
const app = express();
const port = process.env.port || 3000;
app.set("view engine", "pug");
app.set("views", process.cwd() + "/views");
app.get("/", (req, res) => {
//handle route: get requests for "/"
@Samjin
Samjin / Constructor and prototypeFactory
Last active July 10, 2023 04:51
Constructor and prototypeFactory
class Car {
constructor(options) {
this.doors = options.doors || 4;
this.state = options.state || "brand new";
this.color = options.color || "silver";
}
}
class Truck {
constructor(options) {