A warm up for the upcoming RPG Maker MV

So if I wanted to have an object hold a reference to another object, that's out of the question?
Are you referring to like, PHP variables that can "hold" data in a string or integer? 

$name = 'dorothy';

for example?

Or "hold a reference" in what other way?
you can hold references:

var myObject.aProperty = otherObject;The problem is the left side, the "property name" is a string:

var aThing[[1, 2, 3]] = 23;is the same as

var aThing[ ([1, 2, 3]).toString() ] = 23;Another crazy stuff you should check:

0 == false // true0 == ''       // trueLike php, if you want to really check values, use ===

Code:
0 === false // false0 === ''       // false
in php, if you wanna check the status of a variable, it's var_dump($variablename);
You can use on mobile browsers:

console.log(object);Chrome even let you edit the object on via its console 😀

y prefer, for php, print_r

$name = print_r(obj, true);So y can do things like:

"I like to print this string, just cuz my name is {$name}"Really idiomatic code and easy to understand (that is why I always use {}, even if $name would work fine in that case.
I don't think print_r tells you if the $variable is a string, array or integer or the like though. If you just want the content though, yes it is better.

P.S you could just print_r(obj, true); I think. Not tested though, so I could be wrong. Probably depends what obj/true actually is/are. If it is print_r($variable); though, yes, that would be the simplest way to do it unless you want to reuse $name in your example.
Are you referring to like, PHP variables that can "hold" data in a string or integer? 

$name = 'dorothy';

for example?

Or "hold a reference" in what other way?
I mean like in Ruby where you can have a Battler object storing a reference to an array of equip objects, which themselves store references to various other objects.

The problem is the left side, the "property name" is a string:

var aThing[[1, 2, 3]] = 23;is the same as
Code:
var aThing[ ([1, 2, 3]).toString() ] = 23;
Oh, I misunderstood what you meant.

I thought you meant properties cannot store anything but strings lol
I don't think print_r tells you if the $variable is a string, array or integer or the like though. If you just want the content though, yes it is better.

P.S you could just print_r(obj, true); I think. Not tested though, so I could be wrong. Probably depends what obj/true actually is/are. If it is print_r($variable); though, yes, that would be the simplest way to do it unless you want to reuse $name in your example.
It can be a constant, or a variable or a literal... not a function, I still don't know 'why'

But yes, the most common case is usoing ob as $obj.

Anyway,  for debugging php I prefer Kint (http://raveren.github.io/kint/)

But this is a talk about Javascript, not PHP after all, lets better try to ofcus on that language... PHP is another kind of beast.

I preffer JS over coffeescript or others, if you ask "youd I use pure JS" I would say "yes, of course"
Also, multi dimensional arrays are not allowed, well, not like ruby:
Could you clarify this?

// multi dimensional array in JSvar myArray = [["string1", "string2"], [1, 2], [true, false]];Also:

an_item[2][3] // is valid, but it also means another thing technically
What is the other thing that this means?
Could you clarify this?

// multi dimensional array in JSvar myArray = [["string1", "string2"], [1, 2], [true, false]];Also:

What is the other thing that this means?

In ruby, you can use an object like Table in RGSS:

x[1, 2] in ruby is not really an array of arrays.

array[1, 2] # this is a multi-dimensional array
Code:
array[1][2] # this are nested arrays
Their concepts are different, one takes an idea from a matrix and the other is an array having more arrays inside.

They also work different, usually the table is just a single array internally and you get the index by doing:

table[x, y] == table[x % width + y * width ]This is a little mor efficient than the array of arrays method
If you want to know more about the array of arrays method search for jagged arrays on google.
Javascript doesn't support multithreading, right ?  🙁
http://stackoverflow.com/questions/30036/javascript-and-threads
I've briefly searched the performance benchmark comparison between Javascript and Ruby and found these:

http://raid6.com.au/~onlyjob/posts/arena/

http://benchmarksgame.alioth.debian.org/u64/compare.php?lang=v8&lang2=yarv

http://benchmarksgame.alioth.debian.org/u32/compare.php?lang=v8&lang2=yarv

https://bjpelc.wordpress.com/2015/01/10/yet-another-language-speed-test-counting-primes-c-c-java-javascript-php-python-and-ruby-2/

If Javascript is really faster than Ruby in general(there are always cases where the opposite's true though 😀 ), with the increased minimum system requirements of RMMV(compared to those of RMVXA), it seems to me that RMMV scripts can afford more costly calculations when they're called for 🙂
It can be a constant, or a variable or a literal... not a function, I still don't know 'why'

But yes, the most common case is usoing ob as $obj.

Anyway,  for debugging php I prefer Kint (http://raveren.github.io/kint/)

But this is a talk about Javascript, not PHP after all, lets better try to ofcus on that language... PHP is another kind of beast.

I preffer JS over coffeescript or others, if you ask "youd I use pure JS" I would say "yes, of course"
I would prefer pure JS or TypeScript than CoffeeScript 😀
I can now make my JS count numbers and tell if its odd or even... Also did a "class" and a child of that class
Well ruby has the methods even? and odd? in integer, but usually you can check it by doing:

number & 1  == 0 // number is evennumber % 2  == 0 // number is evenYou can also change the zero check by doing !! like:

!!(number & 1)!!(number % 2)Javascript's speed really is just a matter of what it does,

think than javascript does not have integers, while this seems trivial, integer operations are arround 1.5 times faster than floating point operations.

Of course it depends on the VM, V8 is awesome, SpiderMonkey is great, but you know how awful is in IE8 (wich some people STILL have, arround 10% of the traffic in the pages I manage are visited with IE8)
I mean like in Ruby where you can have a Battler object storing a reference to an array of equip objects, which themselves store references to various other objects.

Oh, I misunderstood what you meant.

I thought you meant properties cannot store anything but strings lol
This is one of the best aspects of Javascript: http://www.w3schools.com/js/js_json.asp

---

I wonder if its going to support jQuery.
jQuery is only really needed when you are working with DOM (in other words, HTML) or AJAX calls (wich are easy to implement normally too) you may want to add jQuery or prototype, but I don't see the use of that in your game.

There is a pc version, after all.

JSON is one of the cool aspects of javascript, the only 'problem' is that it doesn't support function declarations.

probably we will have our database in JSON (or having some black magic to read it with blobs ad file apis in html)
jQuery is only really needed when you are working with DOM (in other words, HTML) or AJAX calls (wich are easy to implement normally too) you may want to add jQuery or prototype, but I don't see the use of that in your game.

There is a pc version, after all.

JSON is one of the cool aspects of javascript, the only 'problem' is that it doesn't support function declarations.

probably we will have our database in JSON (or having some black magic to read it with blobs ad file apis in html)
Well, its not HTML5? I read it in some topic around here, maybe is not a good information.

I dont understood what you meant by "support function declarations", you can have anything you like inside a JSON object
Not really, this is not valid JSON:

{  'my_callback' : function (x, y) { return x * y;  } }It is done for security reasons, you may know how dangerous are callbacks like this...

It is HTML5 (the web version) there are PC and MAC versions wich may or may not use HTML5 (they may use something like V8 inside a C++ APP)

Original thread: https://forums.rpgmakerweb.com/threads/a-warm-up-for-the-upcoming-rpg-maker-mv.43346/