Closed pixelzoom closed 5 years ago
This would also be an excellent place to try an ES6 template string. Note the use of backquotes:
var xyEqualString = `(${xString},${yString})${equalString}`;
Thanks, changed to an ES6 template string in the above commit and removed and removed StringUtils.format here.
Noted in https://github.com/phetsims/scenery-phet/issues/446#issuecomment-460732512...
In CoordinatesRow:
First, let's do something about those var names. Var names start with lowercase, not uppercase.
Second is the use of a string pattern. If you're using
StringUtils.format
to avoid string concatenation, why use string concat to create the pattern? And why tack onequalString
using string concat? I would expect to see:Since this doesn't involve any translated strings, it should technically be converted to named placeholders and
StringUtils.fillIn
, i.e.:But... I see little value in using a string pattern here, and I think string concat would be fine, probably even clearer. I.e.: