diff --git a/build/phaser.d.ts b/build/phaser.d.ts index 851f2b8cc..ea07d3f2c 100644 --- a/build/phaser.d.ts +++ b/build/phaser.d.ts @@ -1959,7 +1959,7 @@ declare module Phaser { createMultiple(quantity: number, key: string, frame?: any, exists?: boolean): Phaser.Sprite; destroy(destroyChildren?: boolean, soft?:boolean): void; divideAll(property: string, amount: number, checkAlive?: boolean, checkVisible?: boolean): void; - forEach(callback: Function, callbackContext: Object, checkExists: boolean): void; + forEach(callback: Function, callbackContext: Object, checkExists?: boolean): void; forEachAlive(callback: Function, callbackContext: Object): void; forEachDead(callback: Function, callbackContext: Object): void; forEachExists(callback: Function, callbackContext: Object): void; diff --git a/src/core/Group.js b/src/core/Group.js index c77839d1c..5bae30a31 100644 --- a/src/core/Group.js +++ b/src/core/Group.js @@ -1021,14 +1021,11 @@ Phaser.Group.prototype.postUpdate = function () { * @method Phaser.Group#forEach * @param {function} callback - The function that will be called. Each child of the Group will be passed to it as its first parameter. * @param {Object} callbackContext - The context in which the function should be called (usually 'this'). -* @param {boolean} checkExists - If set only children with exists=true will be passed to the callback, otherwise all children will be passed. +* @param {boolean} [checkExists=false] - If set only children with exists=true will be passed to the callback, otherwise all children will be passed. */ Phaser.Group.prototype.forEach = function (callback, callbackContext, checkExists) { - if (typeof checkExists === 'undefined') - { - checkExists = false; - } + if (typeof checkExists === 'undefined') { checkExists = false; } var args = Array.prototype.splice.call(arguments, 3); args.unshift(null);