Skip to content

Commit 7f9c822

Browse files
committed
modified toString
1 parent a124b54 commit 7f9c822

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

chapter10/01-SortingSearchingAlgorithms.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ function ArrayList(){
1313
};
1414

1515
this.toString= function(){
16-
var s = array[0] ? array[0] : '';
17-
for (var i=1; i<array.length; i++){
18-
s += ', ' + array[i];
19-
}
20-
return s;
16+
return array.join();
2117
};
2218

2319
this.bubbleSort = function(){

0 commit comments

Comments
 (0)