Sample Video Frame
03: Simple Math and Strings
In this code sample you will learn what a string is and also how to do some simple math, as well as use a little bit of the Math library. As usual, you are to type this code in, get it working, and watch the video for additional information on these concepts. You should also attempt to break this code and change it in some way that you find interesting.
// You can give multiple things for console.log to print. // Separate each thing with a comma. console.log("Name:", 'Zed A. Shaw'); console.log("Age:", 43); console.log("Feet Tall:", Math.floor(74 / 12)); console.log("And Inches:", 74 - (Math.floor(74 / 12) * 12)); console.log("Age * Height:", 43 * 74); console.log("Age * Feet:", 43 * Math.floor(74 / 12));
'Like this', with a double-quote
What You Should See
As before when I run this I get the following:
$ node "code.js" Name: Zed A. Shaw Age: 43 Feet Tall: 6 And Inches: 2 Age * Height: 3182 Age * Feet: 258
Register today for the Early Access course and get the all currently available videos and lessons, plus all future modules for no extra charge.
Still Not Sure? Try the next FREE Lesson!