In this lesson, we’ll look at the propPath utility function. We’ll ask for a property multiple levels deep in an object and get back a Maybe. We’ll get a Just when the property exists at our path and a Nothing if any part of the path is undefined. co…
In this lesson, we’ll use a Maybe to safely operate on properties of an object that could be undefined. We’ll use our initial code as the basis for a prop utility function that can be reused with different objects and various property names. Instead…
public class Employee { public Employee() { this.Insurance = new Insurance(); } // Perhaps another constructor for the name? public Employee(string name) : this() { this.Name = name; } public string Name { get; set; } public Insurance Insurance { get…
Sometimes, we run into situations where we end up with a Maybe within the context of another Maybe. Nested structures like this can get really confusing to work with. In this lesson, we’ll look at an example of this and see how chaincan help us out b…
javascript nested object merge deep copy Object reference type function namespace(oNamespace, sPackage) { // deep copy let res = oNamespace; const arr = sPackage.split("."); // ["a", "b", "c", "d"] const…