- Use REPL
- Execute code in REPL
- Exit REPL
A good understanding of Node REPL will give you a tool to test your Node code quickly. We'll practicing using the REPLY by writing a sum
function and using JavaScript's Date
instance.
- 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, 11, 31)
for Dec 31, 2015. See the resources below for help withDate
. - Exit REPL
View node-repl-lab on Learn.co and start learning to code for free.