Recent Posts

How do I duplicate a line within Visual Studio Code?

Chris Green September 26, 2018 No Comments Development ,

If you want to easily duplicate a line of code in Visual Studio Code, you can do it with a simple keyboard shortcut. Just use the Copy Line Down (Ctrl+Alt+UpArrow) or Copy Line Up commands (Ctrl+Alt+DownArrow) — depending on where you want the new line inserted with respect to your cursor. You can view all the shortcuts […]

JavaScript — Loop Over an Array with forEach() Method

Chris Green August 27, 2018 No Comments Javascript , ,

You can use the forEach() method to loop over an array and execute a function on each element of the array. Example var pets = [‘dog’, ‘cat’, ‘monkey’]; pets.forEach(function(element) { console.log(element); }); // expected output: “dog” // expected output: “cat” // expected output: “monkey”   For more information:

Electron Error: Not allowed to load local resource

Chris Green August 25, 2018 No Comments Development, Javascript , , ,

I’ve recently begun playing with Electron (the library that lets you build cross-platform desktop apps with web technologies). And not long into trying to hook up my default HTML page I received this error: Not allowed to load local resource I was certain I’d typed the line to load the URL just like the tutorial […]

What is the JavaScript ternary operator?

Chris Green August 21, 2018 No Comments Javascript , ,

The ternary operator is a JavaScript Operator which will return one of two values depending on a conditional supplied. Basically, you supply any conditional which will evaluate out to true or false and it will return one of the two expressions. It is set  up as such: condition ? expression1 : expression2 If the condition […]

JavaScript — delete a property from an object

Chris Green August 20, 2018 No Comments Javascript , ,

You can remove a property from a JavaScript object with the delete operator. And it’s super easy: delete Example var Car = { make: “Mazda”, model: “CX-5”, year: “2014” }; console.log(Car.year); // expected output: “2014” delete Car.year; console.log(Car.year); // expected output: undefined   For more information:

Page 1 of 1