Want to Learn JavaScript Classes? Try the Amazing Word Game!

preview_player
Показать описание
Learning how to program JavaScript classes should be fun… Not only are classes considered the modern way to do things… they’ve also been upgrade over the last few years… this is 2023, so don’t miss out!

This tutorial teaches you how to create your 1st simple class; we then add a constructor, some class methods (AKA functions), and then pick up the pace by creating the amazing word scramble game.

What is the “this” keyword all about? Honestly, it’s way simpler than most people give it credit for – one copy of “this” class variable (let’s not forget methods) is owned by (i.e. given to) each class instance… that’s it!

We instantiate multiple objects – a game class instance, and several player class instances. The game class has an array of player class instances, thereby having control over the players via the game object.

00:00 - JavaScript classes introduction
02:31 - The "this" keyword simplified
04:34 - Class object inside another class
06:48 - Classes interacting with each other
08:31 - Adding more game class methods
10:37 - Testing registering multiple players
11:27 - Logging error requires more code
13:06 - Fisher–Yates shuffle word scramble
Рекомендации по теме