is possible combine these 2 lines of code one?
meaning, can tostring() , .replace() in 1 line?
var mysecondvar = myfirstvar.tostring() mysecondvar = mysecondvar.replace("a","u");
yes, can chain methods.
myfirstvar.tostring().replace('a', 'u') note:
tostringshouldtostringstring#replacereplace first occurrence of string. replace occurrences use replace regex
Comments
Post a Comment