Untitled

mail@pastecode.io avatar
unknown
javascript
2 years ago
1.2 kB
5
Indexable
Never
function add_zeros(_number, _dozens){
    return _number*10**(_dozens)
    
}
function make_number(_m){
    let result = 0;
    index=0;
    console.log(typeof _m)
    for (let i of _m){
        result+=add_zeros(i,index);
        index+=1;
    }
    return(result)
}
var addTwoNumbers = function(l1,l2){
    let result=make_number(l1)+ make_number(l2)
    let res = Array.from(result.toString(10))
    return res.reverse()
};


/*
Line 22 in solution.js
    for (let i of _m){
                  ^
TypeError: _m is not iterable
    Line 22: Char 19 in solution.js (make_number)
    Line 29: Char 16 in solution.js (addTwoNumbers)
    Line 45: Char 19 in solution.js (Object.<anonymous>)
    Line 16: Char 8 in runner.js (Object.runner)
    Line 34: Char 26 in solution.js (Object.<anonymous>)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
*/