do you need a semicolon in javascript

JavaScript
// semicolons are optional because javascript is smart to detect where a line of code ends!!!
console.log(45)
console.log(45);

// there still the same//When to use semicolons in java script. Look at each line!
console.log("USE ; IN YOUR CODE!"); //SEMICOLON NEEDED
function semiHelp() { //SEMICOLON NOT NEEDED
  var i = 0; //SEMICOLON NEEDED
  console.log("Use semicolons when you end all lines of code, though...");
  console.log("There not required to be used at the start of brackets...");
  console.log("And there not needed in comments.");
}; //SEMICOLON NEEDED
//Hope this has been helpful!
Source

Also in JavaScript: