A Global Catastrophe

Variable ruby_x gets created in Ruby; no need for any keyword.
Variable x gets declared in JavaScript with no keyword.
Variable ruby_y gets created within a method.
Variable y gets declared within a JavaScript function and without the benefit of var, let or const.
Declared inside the method, variable ruby_y is undefined outside of it.
The scope of variable y exceeds the confines of the function within which it was declared.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store