{"action":"created","issue":{"url":"https://api.github.com/repos/zhufengnodejs/201508ajax/issues/15","labels_url":"https://api.github.com/repos/zhufengnodejs/201508ajax/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/zhufengnodejs/201508ajax/issues/15/comments","events_url":"https://api.github.com/repos/zhufengnodejs/201508ajax/issues/15/events","html_url":"https://github.com/zhufengnodejs/201508ajax/issues/15","id":126561497,"number":15,"title":"12.写一个惰性函数","user":{"login":"zhufengnodejs","id":11471150,"avatar_url":"https://avatars.githubusercontent.com/u/11471150?v=3","gravatar_id":"","url":"https://api.github.com/users/zhufengnodejs","html_url":"https://github.com/zhufengnodejs","followers_url":"https://api.github.com/users/zhufengnodejs/followers","following_url":"https://api.github.com/users/zhufengnodejs/following{/other_user}","gists_url":"https://api.github.com/users/zhufengnodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/zhufengnodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhufengnodejs/subscriptions","organizations_url":"https://api.github.com/users/zhufengnodejs/orgs","repos_url":"https://api.github.com/users/zhufengnodejs/repos","events_url":"https://api.github.com/users/zhufengnodejs/events{/privacy}","received_events_url":"https://api.github.com/users/zhufengnodejs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-01-14T02:13:43Z","updated_at":"2016-01-14T02:22:24Z","closed_at":null,"body":""},"comment":{"url":"https://api.github.com/repos/zhufengnodejs/201508ajax/issues/comments/171509076","html_url":"https://github.com/zhufengnodejs/201508ajax/issues/15#issuecomment-171509076","issue_url":"https://api.github.com/repos/zhufengnodejs/201508ajax/issues/15","id":171509076,"user":{"login":"jingruia","id":16097198,"avatar_url":"https://avatars.githubusercontent.com/u/16097198?v=3","gravatar_id":"","url":"https://api.github.com/users/jingruia","html_url":"https://github.com/jingruia","followers_url":"https://api.github.com/users/jingruia/followers","following_url":"https://api.github.com/users/jingruia/following{/other_user}","gists_url":"https://api.github.com/users/jingruia/gists{/gist_id}","starred_url":"https://api.github.com/users/jingruia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jingruia/subscriptions","organizations_url":"https://api.github.com/users/jingruia/orgs","repos_url":"https://api.github.com/users/jingruia/repos","events_url":"https://api.github.com/users/jingruia/events{/privacy}","received_events_url":"https://api.github.com/users/jingruia/received_events","type":"User","site_admin":false},"created_at":"2016-01-14T02:22:24Z","updated_at":"2016-01-14T02:22:24Z","body":"```javascript\r\nfunction fn1(a,b){\r\n    return a-b;\r\n}\r\nfunction fn2(a,b){\r\n    return a+b;\r\n}\r\nfunction fn3(a,b){\r\n    return a*b;\r\n}\r\nfunction Max(a,b){\r\nvar fn=[fn1,fn2,fn3];\r\n    var max=fn[0](a,b),maxfn=fn[0];\r\n    for(var i=0;i<fn.length;i++){\r\n        var val=fn[i](a,b);\r\n        if(val>max){\r\n            max=val;\r\n            maxfn=fn[i];\r\n\r\n        }\r\n    }\r\n    Max=maxfn;\r\n    return max;\r\n}\r\n\r\nconsole.log(Max(3,2));\r\nconsole.log(Max(3,4));\r\nconsole.log(Max(5,5));\r\n```"}}