Laziness, function currying, function composition, & other knick-knacks¶
Lazy evaluation¶
Todo
complete this section
where bindings¶
Todo
complete this section
where vs let¶
Todo
complete this section
$ operator¶
Todo
complete this section
Function currying¶
Sample javascript code for currying¶
function searchStudent(studentList, studentName) {
for(var i=0; l = studentList.length; i<l; i++) {
if(studentList[i].name==studentName) {
return studentList[i];
}
}
return null;
}
searchStudent(list, "Saurabh");
searchStudent(list, "Kahlil");
searchStudent(list, "Aatish");
function searchStudentInList(studentList) {
return function(studentName) {
return searchStudent(studentList, studentName);
}
}
var studentSearcher = searchStudentInList(list);
studentSearcher("Saurabh");
studentSearcher("Kahlil");
studentSearcher("Aatish");
Todo
complete this section
Function composition (.)¶
Todo
complete this section