Hacker Newsnew | past | comments | ask | show | jobs | submit | Killusions's commentslogin

Thanks, I edited it to include this, just to make it clear.


Hey, if you think you found a mistake, please also tell me what it is so I can fix it.


The error message talks about having flags set wrong and doesn't complain about anything the code is doing.

Also your code for "Tuple Optional Elements and Rest" is broken. Pad is declared twice and it's returning the wrong thing.


Thanks, I fixed both of them.


I think you mean to have undefined after the equal sign, otherwise I don’t see how there could be an error


Yes, the error was also wrong, fixed it.


I'd also assign undefined to 'age' to show that it's not erroring


Good point, done.


Ironically this is the only JavaScript change (except for top level await) I did not include, maybe I'll edit it and add it.


Those are 2 of the most significant (and eagerly awaited) new(er) features though (although I thought BigInt was more like 5-6 years old)

edit: Edge and Safari only added support in 2020, so it has only been useable without polyfills for a few years


I added them now so the article is complete.


I think one can both learn about the new features without feeling the need to use them all or refactor old code.

My biggest learning while writing this was just how much is possible in JavaScript and TypeScript now, but I also realize that a lot of this I will not use myself or only use to understand some really specific code.


I haven't found one yet, but I'm sure there's one somewhere out there. I will try to keep updating this article so someday it will be what you're looking for.


I took the time to explain all the latest (and some older) JavaScript and TypeScript changes, including code examples.


Symbols are not an ES2022 feature. I believe they were introduced in ES2015.


Just looked it up, you are of course correct. I will move them into the "Past" part.


Looked up on MDN (and from there the ES spec), import assertions don't seem to actually be standard. You might want to mark that somehow (or drop it).


You are correct, I added a note.


Thanks for doing this! I found this post very helpful to get exposed to recent changes from the last couple years.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: