I'm new to Javascript and want to make simple games with Phaser 3, and I found that Javascript seems to be a little different from other OOP languages like C++ or Java. I checked out the tutorial in the official website and some other tutorial page, most of the code is like:
var config = {
...
scene: {
preload: preload,
create: create,
update: update
}
}
var game = new Phaser.Game(config)
function preload(){
this.load.img(...)
}
My question is what is the "this"
in the preload()
indicate to? Is it means the "game"
we defined before?
And how to check the object's class in console? typeof()
only tells "object"
.