Skip to content

Commit 7164f79

Browse files
authored
Merge pull request #1785 from adamyala/2nd-ed
fix function capitalization in apA.md
2 parents fcbd9b8 + 4f7fe65 commit 7164f79

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

scope-closures/apA.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -885,11 +885,11 @@ What about an IIF that does have external references, is that closure?
885885

886886
```js
887887
function printLabels(labels) {
888-
var list = document.getElementByID("labelsList");
888+
var list = document.getElementById("labelsList");
889889

890890
labels.forEach(
891891
function renderLabel(label){
892-
var li = document.createELement("li");
892+
var li = document.createElement("li");
893893
li.innerText = label;
894894
list.appendChild(li);
895895
}
@@ -909,7 +909,7 @@ To understand why, consider this alternative form of `printLabels(..)`:
909909

910910
```js
911911
function printLabels(labels) {
912-
var list = document.getElementByID("labelsList");
912+
var list = document.getElementById("labelsList");
913913

914914
for (let label of labels) {
915915
// just a normal function call in its own
@@ -920,7 +920,7 @@ function printLabels(labels) {
920920
// **************
921921

922922
function renderLabel(label) {
923-
var li = document.createELement("li");
923+
var li = document.createElement("li");
924924
li.innerText = label;
925925
list.appendChild(li);
926926
}
@@ -937,7 +937,7 @@ By the way, Chapter 7 briefly mentioned partial application and currying (which
937937

938938
```js
939939
function printLabels(labels) {
940-
var list = document.getElementByID("labelsList");
940+
var list = document.getElementById("labelsList");
941941
var renderLabel = renderTo(list);
942942

943943
// definitely closure this time!
@@ -947,7 +947,7 @@ function printLabels(labels) {
947947

948948
function renderTo(list) {
949949
return function createLabel(label){
950-
var li = document.createELement("li");
950+
var li = document.createElement("li");
951951
li.innerText = label;
952952
list.appendChild(li);
953953
};

0 commit comments

Comments
 (0)