Skip to content

Commit 8629df2

Browse files
committed
few typos corrected
1 parent 414b5f9 commit 8629df2

File tree

6 files changed

+17
-28
lines changed

6 files changed

+17
-28
lines changed

‎function-patterns/currying.html‎

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/***
1414
function application
1515
***/
16-
// define a function
16+
// define a function
1717
varsayHi=function(who){
1818
return"Hello"+(who ? ", "+who : "")+"!";
1919
};
@@ -42,10 +42,10 @@
4242
partial application
4343
***/
4444

45-
// for illustration purposes
46-
// not valid JavaScript
45+
// for illustration purposes
46+
// not valid JavaScript
4747

48-
// we have this function
48+
// we have this function
4949
functionadd(x,y){
5050
returnx+y;
5151
}
@@ -54,29 +54,21 @@
5454
add(5,4);
5555

5656
// step 1 -- substitute one argument
57-
functionadd(5
58-
,
59-
y
60-
)
61-
{
57+
functionadd(5,y){
6258
return5+y;
6359
}
6460

6561
// step 2 -- substitute the other argument
66-
functionadd(5
67-
,
68-
4
69-
)
70-
{
62+
functionadd(5,4){
7163
return5+4;
7264
}
7365

7466
/***
7567
currying
7668
***/
7769

78-
// a curried add()
79-
// accepts partial list of arguments
70+
// a curried add()
71+
// accepts partial list of arguments
8072
functionadd(x,y){
8173
varoldx=x,oldy=y;
8274
if(typeofoldy==="undefined"){// partial
@@ -124,7 +116,7 @@
124116

125117
functionfuncWithArgsFrozen(frozenargs){
126118
returnfunction(){
127-
// could do an optmisation here - if called with no arguments
119+
// could do an optimisation here - if called with no arguments
128120
// return exactly this function.
129121
varargs=Array.prototype.slice.call(arguments);
130122
varnewArgs=frozenargs.concat(args);
@@ -136,8 +128,6 @@
136128
};
137129
}
138130

139-
;
140-
141131
returnfuncWithArgsFrozen([]);
142132
}
143133

‎general-patterns/built-in-prototypes.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
* the code or already part of the JavaScript engine of one of the browsers you support.
2020
* 3. You clearly document and communicate the change with the team.
2121
*/
22-
if(typeofObject.prototype.myMethod!=="function"){
23-
Object.prototype.myMethod=function(){
22+
if(typeofObject.prototype.myMethod!=="function"){
23+
Object.prototype.myMethod=function(){
2424
// implementation...
2525
};
2626
}

‎jquery-patterns/window-scroll-event.html‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@
3535

3636
// preferred v2, timeout instead of interval - no unnecessary ticks
3737
varscrollTimeout;// global for any pending scrollTimeout
38-
varouterPane=$details.find(".details-pane-outer"),
38+
varouterPane=$details.find(".details-pane-outer");
3939

40-
$
41-
(window).scroll(function(){
40+
$(window).scroll(function(){
4241
if(scrollTimeout){
4342
// clear the timeout, if one is pending
4443
clearTimeout(scrollTimeout);

‎object-creation-patterns/sandbox.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
// box.constructor.prototype.m = "mmm"
7474
box.attachEvent=function(){
7575
};
76-
box.dettachEvent=function(){
76+
box.detachEvent=function(){
7777
};
7878
};
7979

‎object-creation-patterns/static-members.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
// Public Static Members
1616

17-
// counstructor
17+
// constructor
1818
varGadget=function(){
1919
};
2020

@@ -110,7 +110,7 @@
110110
returncounter;
111111
};
112112

113-
// overwrite the contructor
113+
// overwrite the constructor
114114
returnNewGadget;
115115

116116
}());// execute immediately

‎object-creation-patterns/sugar-method.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<body>
88
<script>
99
/* Title: method() Method
10-
Description: adding convenient funcationality to a language
10+
Description: adding convenient functionality to a language
1111
*/
1212

1313
if(typeofFunction.prototype.method!=="function"){

0 commit comments

Comments
(0)