Could not manage call chain using coffee script. I am trying to reproduce this in a coffee script:
function htmlEscape(str) { return String(str) .replace(/&/g, '&') .replace(/"/g, '"') .replace(/'/g, ''') .replace(/</g, '<') .replace(/>/g, '>'); }
I try like this:
htmlEscape = (str) -> String(str) .replace (a,b) .replace (c,d)
gets error Parse error on line 13: Unexpected ',' . Can someone help me with the correct chaining syntax?
source share