Skip to content

Commit 06e6421

Browse files
committed
Fix syntax error on Old Safari. Thanks to @Cardoso222
1 parent 203a79f commit 06e6421

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

app/public/js/main.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,15 +254,13 @@ function playFromQueueExchange2(){
254254

255255
// This method capitalizes the string in place
256256
String.prototype.capitalize=function(all){
257-
try{
258257
if(all){
259-
return this.split(' ').map(e=>e.capitalize()).join(' ');
258+
return this.split(' ').map(function(e){
259+
return e.capitalize().join(' ');
260+
});
260261
}else{
261262
return this.charAt(0).toUpperCase() + this.slice(1);
262263
}
263-
}catch(err){
264-
return all;
265-
}
266264
}
267265

268266

0 commit comments

Comments
 (0)