#classsyntax — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #classsyntax, aggregated by home.social.
-
Constructor Can Return DIFFERENT Object?!
Constructors can LIE about what they create! If you return an object, it REPLACES the instance. The 'new' keyword becomes USELESS. instanceof returns false! This breaks OOP principles!
#javascript #javascripttricks #constructor #classsyntax #instanceof #javascriptweird #javascriptquiz #codingchallenge #javascriptshorts #javascriptwtf #oopquirks #advancedjavascript
-
Class Fields Initialize in ORDER?!
Class fields initialize SEQUENTIALLY! Field a tries to access field b BEFORE b is initialized. This creates undefined references that will confuse you!
#javascript #javascripttricks #classfields #initializationorder #undefinedreferences #javascriptweird #javascriptquiz #codingchallenge #javascriptshorts #javascriptwtf #classsyntax #advancedjavascript