Skip to content

Code points #1

@AlgoTrader

Description

@AlgoTrader

Most of JS code is overengineering and bad JS style.

Examples are

Map.prototype._escapeKey = function (key) {
    return '$' + key;
};

just write

function escape(key) {
    return '$' + key;
};

Never make _stuff to make private node.js module funcations

The other example

Map.prototype.get = function (key) {
    return this.has(key) ? this._values[this._escapeKey(key)] : undefined;
};

The same is:

Map.prototype.get = function (key) {
    return this._values[escapeKey(key)];
};

JS is a beatiful language when used properly, please don't write shit code.
I think your JS/node knowledge is poor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions