ãHackerNews翻訳ãã¦ã¿ããã POSTD (ãã¹ãã»ãã£ã¼) ã¨ãã¦ãªãã¥ã¼ã¢ã«ãã¾ããï¼ ãã®è¨äºã¯ããã§ãå ¬éããã¦ãã¾ãã Original article: Partial Application in JavaScript using bind() by Pascal Hartig JavaScriptã®ä¸ã«ã¯ã³ã¼ãããã£ã¨ã·ã³ãã«ã§è¦ãããã§ãããã¿ã¼ã³ãããã®ã«ããã¾ã使ããã¦ããªããã®ãããã¾ããçãããFunction.prototype.bindã¯ãåãã§ããããé »ç¹ã«ä½¿ããã¦ããvar that = thisãvar self = thisã®ä»£ããã«ãªãé¢æ°ã§ããããããã®ã以ä¸ã®ãããªä¾ã§ãã this.setup = function () { this.on('event', this.handleEvent.bind(this)); }; 第1å¼æ°ã
{{#tags}}- {{label}}
{{/tags}}