Skip to content

Instantly share code, notes, and snippets.

@richardtaylordawson
Created February 18, 2019 19:10
Show Gist options
  • Save richardtaylordawson/03617e9dc13acfb26cb63f27443381e8 to your computer and use it in GitHub Desktop.
Save richardtaylordawson/03617e9dc13acfb26cb63f27443381e8 to your computer and use it in GitHub Desktop.
function narcissistic(n) {
var t = 0;
var i = 0;
var v = value.toString();
var l = v.length;
for(; i < s; i++) {
t += Math.pow(v[i], s);
}
return t == n;
}
@mikeytown19
Copy link

Nice! but you should use let; (:

@richardtaylordawson
Copy link
Author

Nice! but you should use let; (:

We found out var was faster that’s why haha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment