+ 1
How to add two strings together in ts or css
I want to add in ts (solo + learn = Sololearn)
4 Antwoorden
+ 3
let a: string = 'Solo';
let b: string = 'learn';
let c: string = a + b;
console.log(c);
+ 1
JavaScript/TypeScript:
console.log("solo"+"learn")
CSS is not a programming language, it is a style language. You can't do that with CSS.
0
Var a: string="solo";
Var b: string="learn";
Var c= a+b;
console.log(c);
0
Asitabh
in typescript and javascript, one should avoid using var and consider using const and let instead.
var is an old convention that has a lot of undesired behavior that can lead to unexpected bugs.
consider it a bad keyword you shouldn't be using anymore.
unfortunately, you can still find code examples using var. maybe the authors just don't care, or they're old tutorials and documentations.
try Googling:
"why avoid using var in typescript and javascript"
the AI gives a pretty good summary of the cons ...