Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Edit issue #29

Open
Chandan4862 opened this issue Sep 28, 2021 · 11 comments
Open

Code Edit issue #29

Chandan4862 opened this issue Sep 28, 2021 · 11 comments

Comments

@Chandan4862
Copy link

Cannot edit code, runs only template

@rom3N123
Copy link

same

@Julienblc
Copy link

same here

@Nick-Dunne
Copy link

Nick-Dunne commented Jun 23, 2022

'+'

@kishoreandra
Copy link

same here :|

@sidratariq
Copy link

same

1 similar comment
@dat-dv
Copy link

dat-dv commented Oct 1, 2022

same

@latentflip
Copy link
Owner

The problem is almost certainly caused by trying to write "modern" JS. The parser code was all based on ES5 from 2014 so if you try to write modern JS (const, arrow functions, etc) it's not going to like it.

Try going old-school and see if it works.

@kishoreandra
Copy link

The problem is almost certainly caused by trying to write "modern" JS. The parser code was all based on ES5 from 2014 so if you try to write modern JS (const, arrow functions, etc) it's not going to like it.

Try going old-school and see if it works.

Thnks Philip, sure ... Any plan to support them too 😜

@latentflip
Copy link
Owner

Hah, half this app was rewritten at jsconf to add features before I gave the talk fueled by a large amount of coffee, 8 years ago. I don't think there's much chance I'd be able to remember how any of it works well enough to support something like that 😆

@davidLi17
Copy link

The problem is almost certainly caused by trying to write "modern" JS. The parser code was all based on ES5 from 2014 so if you try to write modern JS (const, arrow functions, etc) it's not going to like it.

Try going old-school and see if it works.

thinks a lot.

[1, 2, 3, 4].forEach((el) => {
console.log(el);
})
//asynchronous
async function asyncForEach(array, callback) {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array);
}
}
asyncForEach([1, 2, 3, 4], (el) => {
console.log(el);
})

this code can`t work. Just Because I use the arrow functions

@davidLi17
Copy link

Correct Version
[1, 2, 3, 4].forEach(function (el) {
console.log(el);
});
function asyncForEach(array, callback) {
array.forEach(function () {
setTimeout(callback, 0);
});
}
asyncForEach([1, 2, 3, 4], function (el) {
console.log(el);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants