pasture, 4 months ago Corpobrained retard. How about you stop downloading an npm package to pad a string
Corpobrained retard. How about you stop downloading an npm package to pad a string
pasture, 4 months ago function leftPad(str, len){ while(str.length < len) str=" "+str return str } JavaScript developer's worst nightmare
function leftPad(str, len){ while(str.length < len) str=" "+str return str }
JavaScript developer's worst nightmare
7, 4 months ago @pasture > a helper function that doesn't mutate its arguments and returns a value I don't even think JS developers could fathom, let alone have nightmares about it
@pasture > a helper function that doesn't mutate its arguments and returns a value
I don't even think JS developers could fathom, let alone have nightmares about it
pasture, 4 months ago Need a wrapper around the left-pad API, this is way too complicated for a lowly developer like me async function leftPad(str, len){ try { return (await (await fetch("https://left-pad.com/?str=" + encodeURIComponent(str) + "&len=" + len)).json()).result; } catch(e) throw e; } That'll be $6 gorillion per year please
Need a wrapper around the left-pad API, this is way too complicated for a lowly developer like me
async function leftPad(str, len){ try { return (await (await fetch("https://left-pad.com/?str=" + encodeURIComponent(str) + "&len=" + len)).json()).result; } catch(e) throw e; }
That'll be $6 gorillion per year please
Add comment