-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Initial code structure:
async function init(){
console.log('It is working');
var AGENDA = [];
await submit(1);
files.forEach(async (file) => {
var temp = await LOAD(file);
temp = await SORT_FILE(temp);
AGENDA.push(temp);
});
AGENDA.forEach(
(array) => {
console.log(array);
}
)
// await set();
}
Error:
Uncaught TypeError: Property 'handleEvent' is not callable.
Desired function structure:
async function init(){
console.log('It is working');
var AGENDA = [];
await submit(1);
files.forEach(async (file) => {
var temp = await LOAD(file);
temp = await SORT_FILE(temp);
AGENDA.push(temp);
});
console.log(AGENDA);
// await set();
}
Mistaken Array[] display, unavailability to get it with AGENDA[0] or AGENDA.length:
Array []
0: Array(20) [ (5) […], (5) […], (5) […], … ]
1: Array(123) [ (5) […], (5) […], (5) […], … ]
2: Array(51) [ (4) […], (4) […], (4) […], … ]
3: Array(6) [ (6) […], (6) […], (6) […], … ]
4: Array(7) [ (4) […], (4) […], (4) […], … ]
length: 5
: Array []
Another function incorrect log output:
async function init(){
console.log('It is working');
var AGENDA = [];
await submit(1);
files.forEach(async (file) => {
var temp = await LOAD(file);
temp = await SORT_FILE(temp);
AGENDA.push(temp);
});
console.log(AGENDA.length);
// await set();
}
Entire console log:
GET
http://0.0.0.0:8000/system.css
[HTTP/1 404 File not found 0ms]
GET
http://0.0.0.0:8000/null.css
[HTTP/1 404 File not found 1ms]
GET
http://0.0.0.0:8000/images/image.webp
[HTTP/1 404 File not found 0ms]
GET
http://0.0.0.0:8000/images/instruction.webp
[HTTP/1 404 File not found 0ms]
It is working 0.0.0.0:8000:141:25
0 0.0.0.0:8000:149:25
Uncaught TypeError: Property 'handleEvent' is not callable.
GET
http://0.0.0.0:8000/favicon.ico
[HTTP/1 404 File not found 1ms]
Drastically wrong Function:
async function init(){
console.log('It is working');
var AGENDA = [];
await submit(1);
files.forEach(async (file) => {
var temp = await LOAD(file);
temp = await SORT_FILE(temp);
AGENDA.push(temp);
});
console.log(AGENDA[1]);
// await set();
}
Entire console log:
GET
http://0.0.0.0:8000/system.css
[HTTP/1 404 File not found 1ms]
GET
http://0.0.0.0:8000/null.css
[HTTP/1 404 File not found 0ms]
GET
http://0.0.0.0:8000/images/image.webp
[HTTP/1 404 File not found 0ms]
GET
http://0.0.0.0:8000/images/instruction.webp
[HTTP/1 404 File not found 0ms]
It is working 0.0.0.0:8000:141:25
undefined 0.0.0.0:8000:149:25
Uncaught TypeError: Property 'handleEvent' is not callable.
GET
http://0.0.0.0:8000/favicon.ico
[HTTP/1 404 File not found 1ms]
Simply:
console.log(AGENDA[1]); Output: undefined
console.log(AGENDA.length); Output: 0
console.log(AGENDA); Output visually incorrect: Array []
Output: Array [] \n 0: Array(20) [ (5) […], (5) […], (5) […], … ] \n 1: Array(123) [ (5) […], (5) […], (5) […], … ] \n 2: Array(51) [ (4) […], (4) […], (4) […], … ] \n 3: Array(6) [ (6) […], (6) […], (6) […], … ] \n 4: Array(7) [ (4) […], (4) […], (4) […], … ] \n length: 5 \n <prototype>: Array []
files.forEach(async (file) => { AGENDA.push(temp);}
AGENDA.forEach(
(array) => {
console.log(array);
}
)
Error occured one time in directly uncheckable array of entirely checkable wrong 5 : Uncaught TypeError: Property 'handleEvent' is not callable.
Please explain Why should I write it?