Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Does my number look big in this? js

function narcissistic(value) {
   const _value = String(value).split('');

  let _result = 0;

  for (ch of _value) {
    const num = parseInt(ch, 0)

    _result += Math.pow(num, _value.length);
  }

  return _result === value;
  // Code me to return true or false
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to use promise.all 
Javascript :: image and video lightbox react 
Javascript :: react onchange url 
Javascript :: array reduce 
Javascript :: js pass data between pages 
Javascript :: adding event listener to multiple elements 
Javascript :: javascript sleep one second 
Javascript :: javascript split method 
Javascript :: @viewchild in angular :use for take any refrerence of element 
Javascript :: javascript form data 
Javascript :: if and else shorthand 
Javascript :: pass value inside the js file using script tag 
Javascript :: how to pass props to another component 
Javascript :: react select remove the loading indicator 
Javascript :: add marker on map geocoder result mapbox 
Javascript :: delete array 
Javascript :: arrow function vs function in javascript 
Javascript :: mongodb where field is not equal 
Javascript :: pass props in react 
Javascript :: js array map skip element 
Javascript :: prisma.db sqlite 
Javascript :: production server next.js 
Javascript :: react router v6 
Javascript :: document get element by id hover 
Javascript :: get decimals from float javascript 
Javascript :: inline styling to change background color 
Javascript :: alert library css and js 
Javascript :: window.addeventlistener multiple events 
Javascript :: javascript random number 
Javascript :: axios 400 bad request 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =