Well done!
You have completed Hello Full Stack JavaScript !
You have completed Hello Full Stack JavaScript !
Normally JavaScript is written in text editors and linked to an HTML document much like a CSS file. In this lesson, we'll use the browser to quickly explore some of the basics of JavaScript. Here you'll learn some of JavaScript's many built in operations including math.
Resources
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upOne of JavaScript strength is its versatility. 0:00 Usually, we would write our JavaScript in a text editor like Visual Studio Code. 0:03 But we can also write JavaScript directly in the browser using a tool called 0:09 the console. 0:13 We can open the console and quickly get started writing JavaScript. 0:15 In a previous workshop, you created your own profile card using HTML and CSS. 0:19 I've made my own version, which you can check out by clicking the launch workspace 0:26 button, open up the workspace to follow along. 0:30 Once the workspace is open, 0:34 let's click the eye icon in the top right to view this project in the browser. 0:35 From the menu of the Chrome web browser, select View, Developer. 0:41 And finally, Developer Tools. 0:46 On a Mac, the shortcut to do this is Command option i. 0:50 And on Windows, it's Ctrl Shift i. 0:55 Okay, it's time to code. 0:59 The console is an example of a REPL or read evaluate print loop. 1:02 Don't worry if you're not familiar with this. 1:08 You don't need a deep understanding to appreciate and use it. 1:11 Just know, it's a program that reads input, evaluates it, 1:14 print output, then loops over this process as needed. 1:19 JavaScript includes keywords that represent built in commands or 1:24 methods to execute common programming tasks. 1:28 One of those you will often use in your learning journey is console.log. 1:32 Console.log takes a value and prints it to the console. 1:37 In the console, we'll type out console.log. 1:42 And to give this method a value, we'll pass the value between its parentheses. 1:48 Something we'll do often in JavaScript. 1:54 We'll type, Hello FSJS. 1:56 Now when we hit enter, it logs out our message. 2:04 This may not seem extremely useful right away, but as you learn, 2:09 a big part of programming is testing your code often to 2:12 make sure that everything works as expected. 2:15 And that's where console.log comes in handy and can save the day. 2:20 Take a break before the next video and try printing out your own messages. 2:24
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up