(Solved) Cannot Convert Undefined or Null to Object in JS

The error “TypeError: Cannot convert undefined or null to object” happens when JavaScript attempts to convert null and undefined to an object. Below you can see examples of when this error occurs. In the previous example, notice how the Object.assign() , Object.keys() , and Object.values() methods expect a parameter o equivalent to any JavaScript object … Read more

(Solved) TypeScript Array.find() possibly ‘undefined’

Errors like “TS2532: Object is possible ‘undefined’” can happen after defining the value of a variable by using the array.find() method. Here are the possible reasons why thearray.find() method returns undefined: The predicate parameter or callback function passed to the array.find() doesn’t explicitly use the return keyword to return a truthy value. The predicate parameter … Read more

How to Print a Raw Pointer in Rust?

The other day I wrote an article about the dereference unary operator (*) and I needed a way to explain the unary operator by first explaining about pointers in Rust, which are the memory address location of, for example, a variable. However, I didn’t know how to print the pointer of a variable, without displaying … Read more

Rust | (Solved) “Missing type for `const` or `static`”

Have you come across the following error error: missing type for const item in Rust? Chances are, you defined a constant value like this: At first, this doesn’t seem to be an error as Rust is capable of implicitly determine the data type of other non-constant scoped variables (let ) like the one you see … Read more

What is the Meaning of the Asterisk * Symbol in Rust?

Have you recently seen the asterisk (*) symbol in Rust while reading someone else’s code and you are not sure what it means? No worries, this article will explain the meaning of * and show you how it can become handy during development. The asterisk (*) symbol is Rust’s dereference unary operator. The dereference operator … Read more

(Solved) error: toolchain ‘nightly-x86_64-pc-windows-msvc’

Have you ever cloned a Rust project on your local machine, installed all its dependencies, and attempted to compile it but you came across the error error: toolchain ‘nightly-x86_64-pc-windows-msvc’ is not installed. No worries, here is how you can fix this error. To fix the error error: toolchain ‘nightly-x86_64-pc-windows-msvc’ is not installed , make sure … Read more

Rust | Difference between then() vs and_then() vs or_else()

As you learn Rust, you find out more and more functions that sound like they behave in a similar way, when in reality they differ in subtle ways. This is the case for the functions then() , and_then() , and or_else(). No worries, this article will cover each of these methods as well as their … Read more

Rust Error Handling | How to Define Generic Error Types?

Result<T,E> is a common data type that allows propagating Rust errors without necessarily crashing the Rust program unless the program panics. The Result<T, E> is made out of T or generic data type when the result is Ok(T) or Err(E) whenever an error occurs. One common question new Rust developers ask is: How do you … Read more