Message from JavaScript discussions

September 2020

β€” (native code) means (don't put your nose) orπŸ˜… i can't see what you see, binding means additional (native) code will be generated, right.. operations aren't free😫

Message permanent page


Callback is mouse.onclick = callback where callback = handler.bind(scope) is bound, might be => in the constructor function..

function Person(age) {
this.age = age;
this.hasAge = () => this.age
//this.hasAge = () => age

β€” I think better would be getAge instead of hasAge.. otherwise I would expect boolean value

β€” Exactly

β€” Or if you like functional style:

const person = age => ({ age })
const getAge = person => person.age
const father = person(50)
const fatherAge = getAge(father)

Message permanent page

β€” Const const const const 🀀

β€” Yes.. a good brick wall is better than a v-shaped mess

β€” If you have now an array of persons.. how do you retrieve their age?
in OOP style: => person.getAge())

in FP Style:

Message permanent page

β€” ScatteredπŸ˜‘

β€” Expressive, I would say 🧐

β€” Could it be that the code generates a situation, where age is the same for each person? so where ever I change age it will be the identical value, while "John";"Jane";

stay disjunct properties?

Message permanent page

β€” Unlikely