JavaScript: imm. function