Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
hack64563y$ npm install string-concat --save
const stringConcat = require('string-concat');
let result = stringConcat( "Hello", " ","world");
console.log(result);
// Returns: Hello World -
next up:
$ npm install compare-numbers
var compareNumbers = require("compare-numbers");
compareNumbers.asc(10, 1); // 1
compareNumbers.asc(1, 10); // -1
compareNumbers.asc(10, 10); // 0
because using < <= > >= == is sooooo legacy -
Context is everything.
I’d say it’s ok to concatenate 2 short strings with the + operator. In most cases it’s more readable and the performance loss is negligible.
And if the "modern" style requires a dependency, it’s also a big disadvantage. -
I'd say it's inconsiderate, if it's meant for potentially translatable strings. Other than that - KISS.
Related Rants
Still using + to concatenate strings in JavaScript in 2022?
That's cute.
rant
js