- View Offline
- Exercise Files
- Code Practice
In this video we're going to begin looking at functions, which are a way of …packaging up lines of code that you're going to use repeatedly and make them …into one callable and separately maintainable unit. …So we're going to start out with these four lines of code. …Just four lines of console log that make animal noises, something very important. …So of course, if I'm going to do this repeatedly, in the console it's easy …enough, I can just hit the up arrow and get the same lines of coding again and …make them fire again. And if I'm writing a Java script file, I …could copy and paste the same thing over and over again.…
So for example if I ever need to change it so, say, this first one is not arf but …neigh or what have you, I would have to go back and change each instance of that …in my code, and that's tedious. Perhaps you could just say it's silly. …So, what you would do in that case is define a function, which would wrap up …all these lines into a single unit that I can then use over and over again. …
- Enabling Firebug and web inspectors
- Using a text editor
- Declaring and assigning a variable
- Booleans and the quest for truth
- Working with objects and arrays
- Using operators and control structures
- Iterating with loops
- Objects, references, and functions
- Understanding variable scope
Skill Level Beginner
1. Getting Started
Our friend, the text editor3m 35s
2. Variables and Types
3. Objects, Arrays, and More
4. Operators and Control Structures
5. Iterating with Loops
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.