Christian Heilmann

New array methods in JavaScript bring immutability

June 6th, 2023

JavaScript now has a way to change elements, sort, reverse and splice arrays without changing the original, thus giving it immutability. Four new methods allow you to change arrays without having to create a copy first. The new methods are `with()`, `toSorted()`, `toReversed()` and `toSpliced()`. No need to create a copy with `[...arr]` first. Only […]

The many ways to select the n-th character from a string.

June 2nd, 2023

A question I came across the other day during a JavaScript application test was this: How would you select the n-th character from the word “Example”? The fun thing here is that there are lots of different ways to do that. The one I always forget about is that you can access the index of […]

Nobody thrives on rejection – here are reasons I didn’t take job offers

May 29th, 2023

End of this month is my last day at Microsoft. I didn’t plan this. My original plan was to keep being a representative of that company and work on the amazing products it builds. Market forces, however, caused yet another reorg and as there was no other department with openings for remote work in Germany, […]

PrivateGPT – Running “ChatGPT” offline on local documents

May 27th, 2023

You can download the GPT model and interrogate local files using Python without having to send any data to the cloud. PrivateGPT is a python script to interrogate local files using GPT4ALL, an open source large language model. It is pretty straight forward to set up: Clone the repo Download the LLM – about 10GB […]