From the course: Learning the JavaScript Language

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Arguments and parameters in functions

Arguments and parameters in functions - JavaScript Tutorial

From the course: Learning the JavaScript Language

Arguments and parameters in functions

- [Instructor] In this video, we're going to extend our knowledge of functions using arguments to solve a couple different kinds of problems. The first is taking some data and modifying it. The second is getting an answer to a question in a way we'll need to use repeatedly. We'll start by looking at modifying some data. Let's say I wanted to be able to take any string and change it so it looks like it was being said by Elmer Fudd from the "Looney Tunes" Bugs Bunny cartoons. His manner of speaking changes all R sounds to W sounds. So I have a function called "fuddify", loaded here in Node that does that. We're going to try it out before we look at it. So for example, if I feed that function, "Be very quiet, I'm hunting rabbits," I'll copy and paste that here into my terminal and I get, "Be very quiet, I'm hunting wabbits." And we'll just have a whole bunch of the sorts of things that Elmer Fudd might say. Like, "You screwy…

Contents