#javascript #typescript

Another JavaScript Gotcha

I was working with TypeScript today and I ran into a JavaScript problem that caused me some issues. I needed to fix the number of decimal places in a temperature calculation example. This is my original TypeScript code. let printOutput = (fahrenheit: number, celsius: number) => { console.log(`${fahrenheit}f = ${celsius}c.`); }; let convert = (fahrenheit: number) => { let celsius = ((fahrenheit - 32) * (5 / 9)); return celsius; }; let fahrenheit = 100; let celsius = convert(fahrenheit); printOutput(fahrenheit, celsius); Returns. ...

#linux #windows #bash #scripting

Using PGrep

I often use grep in Windows and Linux to find text in files. I have noticed that grep only works on traditional text files with .txt, .c, .cpp, .list, etc extensions. It doesn’t work with Markdown and C# text files and I find this frustrating. I have found a parallel grep program in the Microsoft Learn code samples written by David Pine that overcomes the grep limitations. The thing that I really like about this program is that I can use regular expressions in the search text. ...