A 400 bytes console.{log,info,warn,...} that return its last argument
at github.com▼2 up and 1 down, posted by
2 up and 1 down, posted by
Identity functions return the first argument passed, not the last. Was there a reason for this architectural / baking choice?
At the beginning, it was the first argument. But I looked more closer à my uses cases and the `console.log` API. `console.log` could be used that way : ``` console.log("The awesome value is : %s", value) ``` And I watched at the use of the comma operator. And, I have choosen to follow the comma operator evaluation. That said the last value of the operation will be returned. ``` const a = () => (add = 1 + 2, add * 3) const a = () => log(add = 1 + 2, add * 3) ``` Both will return 9. And every step of the comma operation will be printed.