Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to rename "function" in JS?

For instance can a write a function using

ಠ(){}

instead of

function(){}

Note: ಠ is a valid identifier according to ECMAScript 6 / Unicode 8.0.0.
https://mothereff.in/js-variables

like image 719
Bryan Grace Avatar asked Dec 08 '25 18:12

Bryan Grace


1 Answers

No, you cannot.

You might be able to use something like Sweet or another JS transpiler.

The logical question that nobody has asked yet is why? My first reaction is that this is an X/Y problem, since function doesn't seem particularly onerous on its own.

like image 140
Dave Newton Avatar answered Dec 11 '25 10:12

Dave Newton