Question: const digitCount 1 = countDigits ( num 1 ) ; const digitCount 2 = countDigits ( num 2 ) ; / / Check if the
const digitCount countDigitsnum;
const digitCount countDigitsnum;
Check if the digit counts are equal
if ObjectkeysdigitCountlength Object.keysdigitCountlength
return false;
Check if the digit counts are equal for each digit
for let digit in digitCount
if digitCountdigit digitCountdigit
return false;
return true;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
