Join Joe Chellman for an in-depth discussion in this video More on arguments, part of Learning the JavaScript Language.
In this video, we're going to look at arguments and functions a little more and …see how you can have functions with variable numbers of arguments, and how …you can provide default values for arguments that you want it to be optional. …So, first I am going to show this function that I've defined called speak …something, and it takes two arguments. Your functions don't have to have one argument. …They can have as many arguments as you want. …So speak something takes two arguments. It takes what to say, hey hey. …And how many times to say it, five times. And so when when I call this, it says hey …hey and also tells me how many times it's said it so far.…
So, you could see, that you can have more than one argument. …But what if, say, you want to provide default values for this. …So what if I know that I want to say hey hey, but I don't care how many times it's said. …I let the function do that for me. Well I can do that. …I can even provide no arguments. And it provides, a default remark, and, …
Author
Released
11/21/2012- 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
Duration
Views
Q: In "How to enable Firebug and web inspectors," at the Chrome Canary part, the author mentions going to the View menu, and then Developer. My Canary has no menu bar. The author uses a Mac, whereas I have Windows. How do I get to the same place?
A: Click the menu button at the top right of Chrome, select More Tools, and then choose Developer Tools.
Related Courses
-
Introduction
-
Welcome1m 31s
-
-
1. Getting Started
-
Our friend, the text editor3m 35s
-
2. Variables and Types
-
3. Objects, Arrays, and More
-
Objects6m 52s
-
Manipulating objects4m 31s
-
Objects and references3m 24s
-
Arrays6m 2s
-
Manipulating arrays7m 27s
-
Readability: Whitespace3m 38s
-
Readability: Comments4m 55s
-
Regular expressions7m 16s
-
-
4. Operators and Control Structures
-
Simple comparisons4m 33s
-
Arithmetic operators6m 54s
-
Logical operators7m 30s
-
Conditionals: If7m 7s
-
Conditionals: Switch5m 59s
-
Type checking5m 31s
-
-
5. Iterating with Loops
-
For loops: Sequential8m 1s
-
For loops: Enumerative4m 58s
-
While loops7m 30s
-
-
6. Functions
-
Basic functions2m 19s
-
Basic uses of functions4m 23s
-
More on arguments4m 13s
-
Functions are objects4m 41s
-
Understanding variable scope5m 30s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake 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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: More on arguments