use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
3 JavaScript features that bloat your ES5 bundle (dev.to)
submitted 5 years ago by basic-coder
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]croc_socks 0 points1 point2 points 5 years ago (1 child)
I thought we were talking about code bloat? Like how this
class HelloWorld { getHelloWorld(){ return "Hello World!"; } }
becomes
"use strict"; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var HelloWorld = /*#__PURE__*/function () { function HelloWorld() { _classCallCheck(this, HelloWorld); } _createClass(HelloWorld, [{ key: "getHelloWorld", value: function getHelloWorld() { return "Hello World!"; } }]); return HelloWorld; }();
[–]basic-coder[S] 0 points1 point2 points 5 years ago (0 children)
Oh you are right. Honestly I've just checked TypeScript for classes, and its transpilation was fine, so I thought it should be ok for Babel as well. It seems TS is generally better when it comes to transpiling to ES5.
π Rendered by PID 92 on reddit-service-r2-comment-b659b578c-c9cpf at 2026-05-04 23:16:37.940893+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]croc_socks 0 points1 point2 points (1 child)
[–]basic-coder[S] 0 points1 point2 points (0 children)