Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Know PHP? Learn JavaScript

DZone's Guide to

Know PHP? Learn JavaScript

· Web Dev Zone
Free Resource

Discover how to focus on operators for Reactive Programming and how they are essential to react to data in your application.  Brought to you in partnership with Wakanda

Years ago I learned PHP because someone else's web form was broken, and I needed to fix it. Apparently this kind of perforce-introduction to PHP is pretty common (and, some say, tends to form bad habits early), so I don't feel too bad about never having learned the language formally.

The result, though, is that my web programming brain leans pretty heavily server-side.

If you're like me, then Stoyan Stefanov's introduction to JavaScript for PHP developers might prove extremely useful.

Stoyan seems like a perfect person to learn from -- he's written six books on JavaScript and PHP -- and his blogpost and presentation are both very clear. For example, here's a PHP associative array:

$fido = array(
  'name' => "Fido",
  'barks' => true
);

and here's the JavaScript object literal he compares it to:

var fido = {};
fido.name = "Fido";
fido.barks = true;

The slideshare presentation, which compares many syntax feature side-by-side, is embedded below. Click through it, or check out Stoyan's article for a more compressed version with lots of helpful comments.

 

Learn how divergent branches can appear in your repository and how to better understand why they are called “branches".  Brought to you in partnership with Wakanda

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}