New to javascript, need some help with basic questions and getting started

Anything that is iterable can be converted to an array so forEach can be used on just about anything that has an order to it.

JavaScript usually applies function level scope to everything unless you define them with let or const (both introduced in 2015).The scope of anything defines in the callback function is that function although you can override what this refers to by specifyig it as the second parameter after the callback.

You could use a for…of loop instead (introduced to JavaScript in 2015) - that iterates over the values rather than over the keys.