Array.from
से Array.prototype.map
को पास करने का प्रयास करते समय मुझे एक अजीब त्रुटि मिल रही है।ऐरे। TypeError से: 0 कोई फ़ंक्शन नहीं है
let fn = Array.from.bind(Array); // [Function: bound from]
fn('test') // [ 't', 'e', 's', 't' ]
['test'].map(s => fn(s)) // [ [ 't', 'e', 's', 't' ] ]
['test'].map(fn) // TypeError: 0 is not a function
पूर्ण त्रुटि:
TypeError: 0 is not a function
at Function.from (native)
at Array.map (native)
at repl:1:10
at REPLServer.defaultEval (repl.js:260:27)
at bound (domain.js:287:14)
at REPLServer.runBound [as eval] (domain.js:300:12)
at REPLServer.<anonymous> (repl.js:429:12)
at emitOne (events.js:95:20)
at REPLServer.emit (events.js:182:7)
at REPLServer.Interface._onLine (readline.js:211:10)
क्या हो रहा है?