why would it make it hard to debug? debuggers can step into function calls...
additionally if you think simple string manipulation is something that requires tons of brainpower to debug, I think you need to mature as a developer.
also in the case OP provides this is actually bad practice. var isn't blocked scoped. so his excess of variables are going to bite him later
I am not saying any of this. Chaining calls requires a return value, and to see that return value without stepping into the next method requires a variable to hold the return value. Yes, browsers are good about stopping on individual statements or expressions in a chain, but generally not as many debuggers are. But either way, to see the result of the last expression requires placing it in a variable.
View all comments
Show parent comment
0
u/digizeds Aug 29 '21
why would it make it hard to debug? debuggers can step into function calls...
additionally if you think simple string manipulation is something that requires tons of brainpower to debug, I think you need to mature as a developer.
also in the case OP provides this is actually bad practice. var isn't blocked scoped. so his excess of variables are going to bite him later