jQuery

Pigs' houses (string arguments)

The story so far

In the last lesson, we looked at function parameters. Parameters let you reuse a function for different purposes. Check this out:

<button onclick="BetterPiggyBank.addCoin(0.01)" ...
<button onclick="BetterPiggyBank.addCoin(0.05)" ...
<button onclick="BetterPiggyBank.addCoin(0.10)" ...
<button onclick="BetterPiggyBank.addCoin(0.25)" ...

They all call the same function:

BetterPiggyBank.addCoin = function(amount) {
  //Do something with amount.
}

Arguments can be strings

amount is a number. So…

bc.

CRUD app

Make a CRUD app, about anything you like.

(If you were logged in as a student, you could submit an exercise solution, and get some feedback.)

Countries

Make a page for country data from the CIA World Fact Book.

(If you were logged in as a student, you could submit an exercise solution, and get some feedback.)