daily log 9.22.20

less than 1 minute read

UWD

//jshint esversion:6
const express = require("express");
const bodyParser = require("body-parser");

const app = express();
app.use(bodyParser.json());

app.set("view engine", "ejs");

const dayWords = {
  0: "Sunday",
  1: "Monday",
  2: "Tuesday",
  3: "Wednesday",
  4: "Thursday",
  5: "Friday",
  6: "Saturday",
};

app.get("/", (req, res) => {
  const today = new Date();
  const day = today.getDay();

  res.render("list", { currentDay: dayWords[day] });
});

app.listen(4040, () => {
  console.log("currently listening on port 4040");
});

What are the two conditions where we set rightChildIdx?

if rightChild > leftChild