/*

This function declares a variable with the “Hello“ string, then

joins it with ” World!”

Then the entire variable is logged to the console

*/

function helloWorld() {

var y = “Hello”;

var x = y + ‘ World!’;

console.log(x);

}

This approach helps us to write code that is easy to read and interpret which can be understood by any new developer who might be looking over your code in the future.

Using comments for testing purposes

Comments can be a great way to test and debug your code. When you are writing your code and facing a problem with its execution, it is sometimes useful to help isolate the problem by ‘removing’ a line of code to see where your script ‘breaks’. ‘Commenting out’ a single line of code is a great way to do this, rather than removing it entirely. Simply add a // in front of the potentially problematic statement, and instantly it becomes a comment, and therefore does not execute. Remember you can also comment out entire blocks of code using block comments. Let’s see some examples of how this might work: