What's New in JavaScript for 2019

fumblepigskin

you’re right… lodash and underscore use it because it is a valid variable name… i guess that is the underlying issue, as @danielbarde pointed out.

fumblepigskin

Sooo… he should listen to you, but you shouldn’t listen to him? Got it.

Dmytro Pylypenko

for these libraries _ just easy remember name convention, there is no any similarity between _.function and this._variable :slight_smile:

fumblepigskin

if i import _ from ‘lodash’ i am bringing that as a variable into the namespace, am I not? it is a valid character in a variable whether or not it is _.map or this._variable. Or am I wrong?

genzj

Totally agree. It’s unnecessary to invent a never been seen meaning of a symbol instead of taking widely accepted practice.

Dmytro Pylypenko

Rethinking are always good effort.
But in current case, I don’t see the real reason to use (IMO)ugly symbol hashtag.

Joe Zimmerman

It’s because people already use _ in the beginning of property names and changing it so that using a valid property name character pricing a variable marks it as private would likely break existing applications

Mike Mitterer

Why not just using TS? It gives you exactly what you want…