Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
Did I break the console with my range function?

range = (arg1, arg2, arg3) => {
    let arr = [];
    let min = Math.min(arg1, arg2);
    if (arg3 != undefined) {
        // let i = min;
        while (min <= Math.max(arg1, arg2)) {
            min += arg3;
            arr.push(min);
        }
    } else {
        for (let i = min; i <= Math.max(arg1, arg2); i++) {
            arr.push(i);
        }
    } 
    return arr;
}

console.log(range(1, 10));
// → [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
console.log(range(5, 2, -1));
// → [5, 4, 3, 2]
// console.log(sum(range(1, 10)));
// → 55


// sum = (arr) => {
//     let sum = 0;
//     for (let numbs of arr) {
//         sum += numbs;
//     }
//     return sum;
// }

// console.log(sum(range(1,10)));
// // 55

I really can't see where I went wrong with this. What's wrong here exactly??

And what's up with the cryptic error messages:

#
# Fatal error in , line 0
# Fatal JavaScript invalid size error 169220804
#
#
#
#FailureMessage Object: 0000009A0CAFE560
 1: 00007FF7D71E815F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+114079
 2: 00007FF7D710343F std::basic_ostream<char,std::char_traits<char> >::operator<<+65023
 3: 00007FF7D7DE2EE2 V8_Fatal+162
 4: 00007FF7D7966D35 v8::internal::FactoryBase<v8::internal::Factory>::NewFixedArray+101
 5: 00007FF7D78271B2 v8::debug::Script::GetIsolate+16706
 6: 00007FF7D769A9A1 v8::internal::CompilationCache::IsEnabledScriptAndEval+26913
 7: 00007FF7D7B39701 v8::internal::SetupIsolateDelegate::SetupHeap+494417
 8: 00000239C87C9080

Please someone help me, I feel like I am blind, I can't begin to comprehend whether there's even any errors in this function.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!