-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
47 lines (39 loc) · 943 Bytes
/
test.js
File metadata and controls
47 lines (39 loc) · 943 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// function isPalidrome(str) {
// var strLen = str.length-1;
// console.log(strLen);
// for(counter=0; counter<=strLen; counter++) {
// console.log( str[counter] +"!=="+ str[strLen-counter] );
// if( str[counter] !== str[strLen-counter] ) {
// return false;
// }
// }
// return true;
// }
//
// console.log(isPalidrome('nayan'));
// console.log(isPalidrome('nayans'));
//
// function adder(x) {
// return function (y) {
// console.log(x+y);
// }
// }
//
// var varX = 1;
// var incrementByOne = adder(varX);
//
// var varX = 10;
// var varY = 10;
// incrementByOne(varY);
function greeter(obj) {
return function (name) {
console.log(obj.type+' ! '+name);
}
}
var greeterObj = {'type':'Hi'};
var hiTo = greeter(greeterObj);
hiTo('Vijay');
greeterObj.type = 'Hello';
// var greeterObj = {'type':'Hello'};
var personName = 'Tanay';
hiTo(personName);