I'm trying to apply this code: How to get X Y Z coordinates of tile by click on Leaflet map - which contains bitwise operator "<<". In the environment that I'm running it on (NodeJS, ExpressJS, AngularJS), codes are checked by ESLint upon compiling it but I need the solution given on the link. I get this error on compilation .
Unexpected use of '<<' no-bitwise
According to this link: http://eslint.org/docs/rules/no-bitwise - ESLint disallows bitwise operators. Is there any way to bypass this rule or if not, provide an alternate calculation that produces similar results to bitwise operation '<<'?
I hope my question is clear, thanks.
2<<3
is the same asMath.pow(2,3)
. Will work for all numbers except 1, you will have to treat that as a special case.c = a << b
can be donec = a===1?Math.pow(2,b-1):Math.pow(a,b);