From bebc5812e54d92fa34bd2020664854f0584396d4 Mon Sep 17 00:00:00 2001 From: Geoffrey Booth Date: Tue, 15 Nov 2016 22:08:27 -0800 Subject: [PATCH] Revert unintended changes to generated index.html --- docs/v1/index.html | 80 +++++++++++++++++++++++++++++++++------------- 1 file changed, 57 insertions(+), 23 deletions(-) diff --git a/docs/v1/index.html b/docs/v1/index.html index b235889e..b08b271b 100644 --- a/docs/v1/index.html +++ b/docs/v1/index.html @@ -170,9 +170,9 @@ square = function(1, 2, 3, 4, 5]; math = { - root: Math.sqrt, - square: square, - cube: function(x) { + root: Math.sqrt, + square: square, + cube: function(x) { return x * square(x); } }; @@ -551,14 +551,48 @@ Block

square = (x) -> x * x
 cube   = (x) -> square(x) * x
-
load
run: cube(5)

+
var cube, square;
+
+square = function(x) {
+  return x * x;
+};
+
+cube = function(x) {
+  return square(x) * x;
+};
+
load
run: cube(5)

Functions may also have default values for arguments, which will be used if the incoming argument is missing (null or undefined).

fill = (container, liquid = "coffee") ->
   "Filling the #{container} with #{liquid}..."
-
load
run: fill("cup")

+
var fill;
+
+fill = function(container, liquid) {
+  if (liquid == null) {
+    liquid = "coffee";
+  }
+  return "Filling the " + container + " with " + liquid + "...";
+};
+
load
run: fill("cup")

@@ -590,20 +624,20 @@ kids = song = ["do", "re", "mi", "fa", "so"]; singers = { - Jagger: "Rock", - Elvis: "Roll" + Jagger: "Rock", + Elvis: "Roll" }; bitlist = [1, 0, 1, 0, 0, 1, 1, 1, 0]; kids = { - brother: { - name: "Max", - age: 11 + brother: { + name: "Max", + age: 11 }, - sister: { - name: "Ida", - age: 9 + sister: { + name: "Ida", + age: 9 } };

load
, - age: 4 + name: 'Tim', + age: 4 });
load