function shuffle(array) {
    let counter = array.length;
    let index = 0;
    // While there are elements in the array
    while(counter > 0){
        // Pick a random index
        index = Math.random() * counter | 0;
        // Decrease counter by 1
        counter--;
        // And swap the last element with it
        swap(array, counter, index);
    }
}
This method asserts whether an object is a Promise instance.
@param object