SimpleSpec.js:82 Uncaught SyntaxError: await is only valid in async function code example

Example: Uncaught SyntaxError: await is only valid in async function

//If you are using reduce(), the since the result of the first accumulation loop 
//will be used in the second second loop.so need one more asyc in front of
// reduce parameters:

const sleep = (n) => new Promise((res) => setTimeout(res, n));

const arr = [1, 2, 3];

const asyncRes = await arr.reduce(ASYNC (memo, e) => {
	await sleep(10);
	return (await memo) + e;
}, 0);

console.log(asyncRes);
// 6
//