JavaScript (aka JS) is a coding language.

The Marcy Lab School Admissions Code Challenge is centered in a coding language called JavaScript. In the world of Software Engineers, there are a lot of different languages they use to build, create, and communicate. JavaScript - or JS, as it’s also frequently abbreviated - is one of those languages, and it’s one of the most common and popular programming languages in the world! At this point, over 98% of all websites that exist were developed using JavaScript. You can use JS to make websites, networking apps (like chats), games, or apps. It’s frequently used to make websites dynamic and interactive.

Now let’s go over some core terms, symbols, and “jargon” that you need to know to start coding in JavaScript:

; semicolon

  • In the world of JavaScript, semicolons play the role that periods play at the end of sentences when we write in English. If you put a semicolon at the end of a line of code, that let’s JavaScript know you’ve completed a command.

  • In the same way that a period indicates to someone you’re finishing one sentence and starting the next when writing, placing a semi-colon ; in your code will let your computer know you're finishing a line of code and preparing to start another.

  • And just like forgetting periods at the end of sentences can create confusion, forgetting semicolons creatings confusion in the land of JavaScript. So go ahead and make a note right now: this little punctuation mark ; will be a key tool for you as you move forward. Just like you don’t forget periods at the end of sentences, make sure you don’t forget your semicolons at the end of each section of your code in JavaScript!

Double Quotes and ‘ Single quotes

  • Have you ever read a book or a play and seen quotes around a piece of dialogue? In the same way that lets you know as a reader that someone is speaking, double quotes and single quotes, in JavaScript, let your computer know you are about to drop in some text or content that it may need to retrieve later.

Comments // or /* */

  • Comments are like little notes you leave for yourself or other people in your code. They don’t affect how your code runs - they’re just there to explain or remind you what you coded and why.

  • If you want to write a single line comment to yourself in JS, you can use // to let your computer know you’re about to create a comment for yourself.

  • If you have a longer note to yourself, you may need to create a multi-line comment. You start a multi-line comment with the symbol /*. Then you write all of the text or notes that are a part of your comment and close that comment out with */.

Input and Output

  • Input is a term we use, as coders, to indicate you are about to feed your code, and we use output as a term for what your code gives you back.

  • If you were sitting next to me and I asked you “Hey, will you add 2+2 and tell me the sum?” and you replied with “the sum is 4.” The question I asked you is the equivalent of an input, and the response you provided is an example of an output.

  • Now, you had to do some work on your own in your brain to create the sum and determine what to share with me. Your program will do that as well, based on code you write.

console.log

  • console.log is a specific JavaScript term or prompt that basically “calls on” specific code in your program.

  • When you type console.log as a coder, you’re basically checking in with your code and prompting JavaScript to find, or activate, things you’ve input. We’ll get into console.log a bit more extensively in our Functions lesson.

CodePens

  • CodePens are a great tool that we will use over the course of our tutorials! CodePens will let you write and test code right from this website, so we’ll set you up from time to time to use a CodePen to practice different concepts in our tutorials. To activate your terminal please press “Run Pen”, also remove “Finally got it” to test the code you want to be tested.

// I am a single line comment

/*
  I am a multi line comment,
  anything inside me won't
  be seen by the program!
*/

// you can also stack
// single line comments
// together like this
// (This is more precise)