#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. ...

#javascript

Working With JavaScript Variable Type Errors

I was struggling to get some code working in JavaScript and realised that I’d made a small variable type error. This is one of the problems in working with a loosely typed language like JavaScript. When I work in C# it is strongly typed meaning that I have to declare a variable and its type at the same time. This saves a multitude of errors in my code. Unfortunately I don’t have this luxury with JavaScript and I have to be more careful with my variables. ...

#javascript

Javascript Training

I have recently completed the Udemy Modern JavaScript Bootcamp 2019 course run by Andrew Mead. It has been one of the most professional courses I have taken in video training. The quality and depth of training would be enough to give a learner a solid understanding of javascript. There is enough content to keep a user going for a couple of months. I did all of the training exercises and have built up a wealth of knowledge and some best practices in JavaScript. ...