You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but it works on all the snippets but one. If it shouldn't be used, than none of them should work not just one. Also you can declare variable with the name async.
I get this error even on the website for babel. (https://babeljs.io/repl/)
these pieces of code work:
const works = ({async}) => {return true}
const alsoWorks = (async=true) => {return true}
const worksAsWell = ([async=true]) => {return true}
but this code doesn't work:
const fails = ({async=true}) => {return true}
even though it works with a function:
const workingFunction = function ({async=true}) {return true}
and any other argument name works:
const differentArgumentName = ({different=true}) => {return true}
So it looks like the error is coming from using the name
async
with a default value on a deconstructed object in an arrow function's arguments.Here is a link to an example
The text was updated successfully, but these errors were encountered: