["default"] is better written in dot notation
9var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10 Object.defineProperty(o, "default", { enumerable: true, value: v });
11}) : function(o, v) {
12 o["default"] = v; 13});
14var __importStar = (this && this.__importStar) || function (mod) {
15 if (mod && mod.__esModule) return mod;
Description
In JavaScript, there are two ways to access the properties of an object:
- dot-notation
(object.property)
( Recommended ) - square-bracket notation
(object["property"])
( Bad Practice )
The dot notation is preferred because it is easier to read, less verbose, and works better with aggressive JavaScript minimizers.
Bad Practice
const x = object["property"];
Recommended
const x = object.property;
x = object[y];