T
T
Triborg-3332020-04-23 16:50:29
JavaScript
Triborg-333, 2020-04-23 16:50:29

Dot after function eg: function Player() -> Player.list = {}?

What does it mean?

For example:

function Player(){
    let self = {x:0, y:0, spdX:0, spdY:0, id:""};
    
    Player.list[self.id] = self;
    return self;
}

Player.list = {};

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2020-04-23
@Triborg-333

in js functions these are objects, therefore they can be set properties, which is done in the example

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question