忽略所有代码清洁度和可读性,哪个脚本会更快完成?
这个:
for(var i = 0; i < 10; i++){
--do that thing--
}
Run Code Online (Sandbox Code Playgroud)
或这个:
--do that thing--
--do that thing--
--do that thing--
--do that thing--
--do that thing--
--do that thing--
--do that thing--
--do that thing--
--do that thing--
--do that thing--
Run Code Online (Sandbox Code Playgroud)
或者它们是相同的,性能方面的?