Syntax differences between JS and Ruby

Okay, so I have been trying out this MV at my friend's PC for a few days now.


I really don't like many things in MV (like all of the "RPG" classes dumped in a huge file, and this whole "plugin" stuff bull, but ohh, well, I can make my scripts without using that... thing...), but I decided to learn a bit of JS with it.


I have searched the internet for a good guide which shows the difference between the syntax usage in Ruby and JS. I found some of them (like array iteration, class making), but I still need many more.


I would look through the default MV scripts for some examples, but sadly, I have no idea where can I find some stuffs I really need.


One of them is hash iteration (or can 'forEach' be used for that too? If so, how exactly?).


I am not asking anyone to write down all the differences (but anyone is free to do so if someone is up for the task, of course). I am asking for an already made list if possible.


Searching for "syntax differences between Ruby and JavaScript" did not yield many useful results, and I have no idea how else could I search for it.


Thanks for any answers in advance!


Edit:


Ohh, and if anyone knows an OFFLINE (downloadable) JS guide/tutorial (in text, not video tutorials), please point me to it as well! Thankies!
and this whole "plugin" stuff bull, but ohh, well, I can make my scripts without using that... thing...)
Unless you want to directly edit the index.html: No, you can't, and there is kinda no reason, since the PluginManager, parameters and easy enabling/disabling of plugins make it easier to handle scripts.You would iterate over an object (there are no hashes) like this:

Code:
for(var key in object) { ... }
or
Code:
Object.keys(object).forEach(function(key) { ... });
In general, JS is a completely different language, so you should probably start from scratch.
I wouldn't call opening billions of boxes to STILL type in the SAME things I could simply type in into my own script txt file any way easier, no matter how I look at it.


I am talking about script settings, such as changing some texts displayed, window sizes, etc.


It makes no difference between writing it inside a (very) little box or inside the txt file itself, aside from the fact that it is very annoying to write long text settings into a (very) small box.


Maybe it's just me liking all my settings inside a big, scrollable text file organized instead of multitude of (very) small boxes.


What do you mean by editing the Index.html file? I already made some custom buttons and text settings for them inside the text files itself, and it works well. o.o


But nevermind that, it is my personal preference, I guess.


Okay, hashes are basically objects, right?


I see, so I must use the keys from the hashes (with the .keys function - convenient, I haven't thought about that 😀 ).


I can't really iterate the object itself with the pairs themselves (key + data)? Or if I can, how would I access the key and the data itself inside the iteration?


I can see many resemblance between Ruby and JS (and between some other languages as well), which let me make some edits here and there already.


Making classes, new methods (called functions here, I think?) and such things. No need for separating all my Ruby knowledge entirely, in my opinion. With a few weeks of practice, I am sure that I can get most of the syntax stuffs right. But I would need an offline JS book for that, because my connection is limited and can't really get any help if I am stuck, which slows me down a whole lot. >.>


Thanks for the help!
Starting with ES6, JavaScript gets a Map class, that allows you to iterate over the entries: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Map


MV utilizies ES5, but since most of ES6's functionalities only represent a thin wrapper over ES5, it is possible to write plugins in ES6 and compile them down to (barely readable) ES5. You probably should ask DarknessFalls about this, since he is (i think) the only one writing his plugins that way.

Original thread: https://forums.rpgmakerweb.com/threads/syntax-differences-between-js-and-ruby.53997/