DEV Community

Calie Rushton
Calie Rushton

Posted on

What I learned last week (38/24)

  1. Reactivity in vanilla JavaScript – use the Proxy pattern to fire events when app state changes. (Frontend Masters course - 'you might not need a framework')

  2. throw new Error("Error!") cannot be used in a ternary (at least not as the 'else' part. The last part of a ternary operator must be an expression, not a function. 'throw' is not an expression, rather it's a statement used to interrupt execution of functions.

  3. A 'stack' in Javascript can be considered a bit like an array, if used in the context of solving problems like you might find on Leetcode. It follows the Last-In-First-Out (LIFO) principle, where elements are added and removed from the same end. Stacks are used to manage function calls, undo functionality etc.

  4. In Javascript any arbitrary number of arguments can be passed to a function. They are accessible via an arguments object which is 'array-like', ie you can use methods such as .length to see how many arguments have been used on the function invocation, for example. (This one is pretty fascinating and well-worth exploring in the console.)

Reinvent your career. Join DEV.

It takes one minute and is worth it for your career.

Get started

Top comments (0)

Image of Bright Data

Maintain Seamless Data Collection – No more rotating IPs or server bans.

Avoid detection with our dynamic IP solutions. Perfect for continuous data scraping without interruptions.

Avoid Detection

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay