Hacker News new | past | comments | ask | show | jobs | submit login

The javascript equivalent would be something like

    Number.prototype.multiply = function({by:multiplier, adding:summand = 0}) {
	return this * multiplier + summand
    }

    console.log((3).multiply({by: 4, adding: 5}))
But of course, javascript APIs are hardly ever written like that. I think it's interesting how the norms of your ecosystem and very small differences in ergonomics in expression make a big difference in behaviour.



Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: