Difference between x.toString() and x+“”

后端 未结 8 1977
暗喜
暗喜 2020-12-11 22:50

Back in college one of my profs. taught us to just do x + \"\" as a quick conversion from basic types to strings.
I don\'t remember which class it was in I

8条回答
  •  时光说笑
    2020-12-11 23:34

    It doesn't matter, really. It is very very unlikely this will cause any performance problems whatsoever. So it remains a matter of personal style. Use whatever you or your team is comfortable with.

提交回复
热议问题