DEV Community

Discussion on: Daily Challenge #183 - Automorphic Numbers

Collapse
 
savagepixie profile image
SavagePixie

I think this should do it in JavaScript:

const isAutomorphic = n => (n ** 2).toString().endsWith(n.toString())