This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Самый лучший способ это использовать стрелочную функцию в методе map, так как у нее нет своего this и она | |
// берет его из родителя | |
function parent() { | |
this.multiplier = 3; | |
return [33, 77, 99, 81, 55].map(I => I * this.multiplier); | |
} | |
// Если мы не можем отказываться от functtion decloration, то можем использовать bind |