Undefined

firststef

Veteran
Veteran
Joined
Jan 3, 2017
Messages
79
Reaction score
9
First Language
Romanian
Where can i effectively define a variable because it seems no matter where i put

var a = 0;
console.log(a)

it shows undefined.

Currently modifying a plugin and i need a new variable.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,025
Reaction score
7,026
First Language
German
Primarily Uses
RMMV
That is exactly the problem - it depends on where you put which command.
And that is not the same answer everywhere, because in some positions it becomes a global definition, in others an instance definition and in still other positions it won't work at all.

Please give a link to the website of the plugin you want to modify and tell us where you want to modify it, then we can help
 

firststef

Veteran
Veteran
Joined
Jan 3, 2017
Messages
79
Reaction score
9
First Language
Romanian
Sorry for the late answer i was in vacation.

I managed it eventually. I was supposed to put the variable above ALL the code and not in a function that i would call, and also remove it from
function(variable) to just function().
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Managed to find a way to hang a bed cover over my window. So no more being toasted alive in the afternoon!:kaoswt2:
So, uh, has anyone tried buying any resources from KokoroReflections? Because I've been looking for a 'buy' button on the site for like 10 minutes now and can't find one.
Any also thought it's too cringy to put the word "and you" in your credit as a special thanks?
Cause that's what I thought...
Everyone in the US right now: Please stay safe.
Symphony Celestia: Prophecy of the Falling Stars RPG Maker music pack WIP. Symphony Celestia is a new series that focuses on symphonic and orchestrated music to tell a story. Each story will include compositions that make up that story from beginning to end. Themes include: Battles, adventures, character themes, etc. Below is a video preview to the first story.

Forum statistics

Threads
97,980
Messages
948,327
Members
129,246
Latest member
Flaminguex
Top