Learn Redux by writing Middleware
jonnyreeves.co.uk6 pointsby phase_90 comments
function convertToHex(value) {
var result;
if (typeof value !== "number") {
result = convertToHex(parseInt(value, 10));
}
else {
result = "0x" + value.toString(16);
}
return result;
}
Also, with regards to default argument values, I've always felt the "native" JavaScript approach was fairly compact and descriptive when required: function doFoo(bar) {
bar = (bar !== undefined) ? bar : "default_value";
}
[0] http://en.wikipedia.org/wiki/Duck_typing
LLMs have made domain knowledge and reasoning "cheap"; it doesn't matter if the output is lower quality - look around you for countless examples of where cheap wins and "cheap" continues to improve.
Good luck out there; we will all need it.