Functions are a fundamental building block of JavaScript. They can be used to perform calculations, manipulate data, and control the flow of execution. In JavaScript, functions are also first-class citizens, which means that they can be treated like any other value. First-class citizen in a programming language means that an entity (such as a function) has the same properties and abilities as other entities. This means that functions can be:…
Month: September 2023
Promises In Javascript
- Posted on
- – Make a comment on Promises In Javascript
Promises In Javascript In this guide, we’ll learn the basics of what a Promise is in Javascript, the why, and how you can use them. Table of content What is a Promise in Javascript First of all, do not overthink the meaning of the term Promise it’s exactly the same promise you know. You know how your mom promises to get you a new cartoon series if you come out with the…
Rust’s Newtype Pattern: Adding Type Safety and Clarity
The newtype pattern is a Rust idiom that can be used to add type safety and clarity to code. At its core, the newtype pattern involves wrapping an existing Rust type (like a number or a string) inside a new struct. This might seem unnecessary at first, but the magic is that this new struct becomes a distinct type and ensures that you are using the correct type where necessary.…