wavesinaroom / my_odin_project_battleship

0 stars 0 forks source link

Ship factory function #1

Closed wavesinaroom closed 1 year ago

wavesinaroom commented 1 year ago

Begin your app by creating the Ship factory function.

Your ‘ships’ will be objects that include their length, the number of times they’ve been hit and whether or not they’ve been sunk.

REMEMBER you only have to test your object’s public interface. Only methods or properties that are used outside of your ‘ship’ object need unit tests.

wavesinaroom commented 1 year ago

It's good to learn javascript syntax instead of transfering similar C++ syntax for future purposes. Today, I realized that my knowledge on javascript objects was weak because I relied on classes.

wavesinaroom commented 1 year ago

At last, Ship is a proper factory function now. It took a lot of time to get it done but I don't care much because I have a much stronger foundation of javascript factory functions. It worthed my time.