Lab4- Ninja Object

Link to Lab4

In this lab, we used javascript and JQuery with objects and methods to create our own panda that has multiple commands. As the image below illustrates, there are three buttons that when pressed a text below will pop up that states the ninja has performed the task.
To complete this we first created an array that defines the ninja such as his name and the commands. Within the commands are functions that would make the text pop up below the buttons. So when the buttons are clicked, it calls the array and the specific command which would then call the function.
This lab was very interesting because it shows just how versatile objects and methods are because we didn't have to create different functions, it was all inside the array and had specific names which made the process less complex.




Comments

Popular posts from this blog

Lab 23-2: Type Ahead

WBL Workshop 2

Lab7 - Simple Accordion