learn-co-curriculum / node-repl-lab

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running JavaScript Code in Node REPL

Objectives

  1. Use REPL
  2. Execute code in REPL
  3. Exit REPL

Introduction

A good understanding of Node REPL will give you a tool to test your Node code quickly. We'll practice using the REPL by writing a sum function and using JavaScript's Date instance.

Instructions

  • Enter REPL
  • Write Node code to perform math by creating a sum function which adds two numbers together and returns the solution. The numbers should be passed as parameters to the function.
  • Write and call the sum function.
  • Find out what the day of the week was the day of the Declaration of Independence (July 4th, 1776) by creating a date object for the date. For example, new Date(2015, 12, 31) for Dec 31, 2015. See the resources below for help with Date.
  • Exit REPL

Resources

View node-repl-lab on Learn.co and start learning to code for free.

About

License:Other