From a1b5a6626f4d18e58f98217f85d164c66db005e3 Mon Sep 17 00:00:00 2001 From: gnieark Date: Sat, 14 May 2016 22:59:22 +0200 Subject: [PATCH] function default parameters in javascript --- src/arenas/connectFour/js.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/arenas/connectFour/js.js b/src/arenas/connectFour/js.js index fe7885b..5db57ba 100644 --- a/src/arenas/connectFour/js.js +++ b/src/arenas/connectFour/js.js @@ -18,7 +18,10 @@ function createElem(type,attributes){ {elem.setAttribute(i,attributes[i]);} return elem; } -function connectFour(bot1,bot2,xd_check, newGame=true){ +function connectFour(bot1,bot2,xd_check, newGame){ + if (newGame === undefined){ + newGame = true; + } document.getElementById('fightResult').innerHTML = ''; //create grid