Skip to content

When and why is it good to create custom exceptions?

I am working on a complex application with different types of errors, services, and domain concepts. In order to throw “object” errors, there are two different approaches that come to my mind: Applying Object.assign() to an Error object (easy option if I just need to throw a single or a couple of …

Mosquitto and simple Paho JS Client

I am trying to get a simple mqtt broker set up and access it from a web page. I have had pretty much 0 luck. I’ve got mosquitto 2.0.14 downloaded and running. Here’s my configuration file: This generates the following log when I run mosquitto -c mosquitto_conf -v Here’s my html file, which I…

How to access a variable outside a subfunction in javascript

I have the following function that uses a GLTF loader to load a model into the scene (imported from another class): And I call that function from another class like this, wanting to push to the players array (meant to keep the players meshes) the gltf.scene mesh returned from the CreateMesh function. My probl…

Languages Statistic

I have to implement the “getLanguagesStatistic” function, which will help the IT magazine summarize 2019 in terms of the popularity of programming languages. As input, the function receives an array of user reviews. You need to return an object in the format {languageName: count, anotherLanguageNa…