Why can't I make a function that logs my data?
If I don't do console.log
in the function, I'm getting the values, but when doing it in a function, the data is hidden.
let stoneArray = [];
let beginningStone = {
a: 200,
b: 200,
c: 10,
d: 2,
e: 5
};
stoneArray[0] = beginningStone;
function consoleData() {
console.log('stoneArray = ' + stoneArray);
}
consoleData();
console.log(stoneArray);