Похожие чаты

Hello, I am usually doing code in ES5 vanilla JS

because I am always afraid of size of my js files, their performances and browsers compatibility. I understand that features of ES6 and TypeScript can possibly ease development but I am unsure to take this road because I don't know if transpiling my code will make it work 100% on older browsers and if size and performance gets negatively affected.

Is it better for me to master just ES5?

2 ответов

11 просмотров

> I don't know if transpiling my code will make it work 100% on older browsers Babeling will transpile such that the JavaScript will work in older browsers, but you will need to polyfill APIs like Promise, Map, Symbol — those that aren't available in older browsers. There's a Babel plugin for this iirc. > Is it better for me to master just ES5? I don't think so, going forward we're getting newer language features, and you'll be left behind. > Right now each of my js file takes like 1-2 KB, sometimes 10 KB If your JS is generally small, you may not need to worry at the moment, but picking up newer JavaScript features will be useful in the long run. Notwithstanding, JavaScript will continue to support everything it had since ES1

I'm a big fan of writing as close to your target as possible, so if I'm writing for web browsers, I'll wait to use a feature until every browser I NEED to support can use it natively. Life's too short for transpiling a dynamic language if you don't need to :D

Похожие вопросы

Обсуждают сегодня

Ну вот просто даже давайте вот как. Какой нибудь конкретный кейс, можете в пример привести, где бч работает и приносит прикладную пользу, а не просто что бы было? Не крипту.
Alexander Andreev
22
Всем привет! Имеется функция: function IsValidChar(ch: UTF8Char): Boolean; var i: Integer; ValidChars: AnsiString; begin ValidChars := 'abcdefghijklmnopqrstuvwxyzABCDE...
Евгений
44
For all those that keep asking why no pump? why this ? and why that...? Please close ur ewt chart and open 2 others - TOTAL (total mc) and BTC.D (btc dominance). Maybe BTC a...
Inn3r_G
19
"Since pnut can flip FTM easily, I'm swapping my FTM to pnut and hoping for a easy x5-x10" Perfect recipe for disaster. NFA but chances are, you'll end up as exit liquidity ...
C. A.
7
объясните пожалуйста, почему функция не работает должным образом? вроде должно брать активное окно сравнивать его размер с размером экрана, и если есть совпадение = true прове...
JF
9
AMD status update? No longer in the plan but something might be around the corner later on Chinese partner? No longer in the plan. This market does not seem to be the top ...
Ben
6
Ready for some fun AND a chance to win TKO Tokens? Join us for exciting minigames in our Telegram group! 🕒 Don’t miss out—games start on today 25 October 2024, at 8 PM! Ge...
Milkyway | Tokocrypto
255
да кстати заметил всюда почему то всех сюда прёт, ни в одном чате столько ботов не прёт как сюда.. Может чота надо доработать?
REDis
15
I get confused when people talk about the ‘bull market’ and the ‘next bull market’ as if anyone really has a clue what’s really going on in the world. First of all - there i...
Shah
1
Мне вот любопытно. Уже сколько времени имею соблазн купить макбук, ибо подозреваю что очень уж удобен будет в связке с другой техникой от эпл которая у меня есть, да и сам по ...
Not Yeromin
13
Карта сайта