JavaScript Introducing ES2015 Classes Sub-Classes

Leo Marco Corpuz
Leo Marco Corpuz
18,975 Points

Setting student dance method to false

I noticed nothing was placed as a parameter when setting the Student dance method to false. Would it be the same if it was written as stevenJ.dance(false)?

1 Answer

Steven Parker
Steven Parker
172,196 Points

Sure, you can explicitly pass "false" if you like. By passing nothing, the parameter's value is "undefined", which is considered "falsey" and therefore is treated the same as if you had provided "false" as the argument.