Timeline for Doubly Linked List Javascript
Current License: CC BY-SA 4.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 29, 2022 at 19:09 | comment | added | Ifthel | @ToniJarjour I added an important edit (besides private fields) showing the use of a getter to make size readonly. This way users can't break your class by setting size themselves. | |
Jun 29, 2022 at 19:07 | history | edited | Ifthel | CC BY-SA 4.0 |
Switched to using private members and using a getter for size.
|
Jun 29, 2022 at 18:27 | comment | added | Ifthel |
@Blindman67 It would be great if you could explain what the class suggestion is missing and which style habits need improving. As for private members, there's the underscore convention (only madmen call underscore functions externally), private members with # (which used to have bad dev-tool support, but I now realize this is fixed), or closures (overkill). Op will likely run into underscores at some point, and their API would probably be defined by JSDoc/TypeScript anyway, but I'll edit my answer to use # .
|
|
Jun 29, 2022 at 14:34 | comment | added | user85459 | @Blindman67 Can you add an answer with a better example please? | |
Jun 29, 2022 at 13:35 | comment | added | Blindman67 | -1 Your advice to use class syntax is ill informed nor have you encapsulated your list object, it can not be trusted, (underscores do not prevent access) and there are several poor style habits in the example code | |
Jun 29, 2022 at 12:48 | comment | added | konijn |
Same, love " I can pretend null doesn't exist."
|
|
Jun 29, 2022 at 12:30 | vote | accept | CommunityBot | ||
Jun 29, 2022 at 10:30 | comment | added | coderodde | I find your answer rather educative, well done! | |
Jun 29, 2022 at 9:44 | history | answered | Ifthel | CC BY-SA 4.0 |