JavaScript Basics Flashcards
What is JavaScript?
JavaScript is a powerful, flexible, and fast programming language used for interactive web development
Define the Console.
The console is a panel that displays important messages, like errors, for developers.
If we want to see things appear on our screen, we can print, or log, to our console directly.
Keywords are words that are built into the JavaScript language, so the computer will recognize them and treats them specially.
What is the purpose of a semi-colon in a line of code?
The semicolon denotes the end of the line, or statement.
Define a comment.
Comments can explain what the code is doing, leave instructions for developers using the code, or add any other useful annotations.
These comments exist just for human readers.
2 types of comment?
A single line comment will comment out a single line and is denoted with two forward slashes // preceding it.
A multi-line comment will comment out multiple lines and is denoted with /* to begin the comment, and */ to end the comment.
Name the 6 primitive data types.
Number String Boolean Null Undefined Symbol
Define a data type.
Data types are the classifications we give to the different kinds of data that we use in programming.
There are 7 fundamental types
What does the “string” datatype involve?
String: Any grouping of characters on your keyboard (letters, numbers, spaces, symbols, etc.) surrounded by single quotes: ‘ … ‘ or double quotes “ … “
What does the “Boolean” datatype involve?
Boolean: This data type only has two possible values— either true or false
What is the Null datatype?
This data type represents the intentional absence of a value, and is represented by the keyword null
What is the Undefined datatype?
This data type is denoted by the keyword undefined and represents an intentional absence
What is the Symbol datatype?
Symbol: A newer feature to the language, symbols are unique identifiers, useful in more complex coding.
What is the Object datatype?
Object: Collections of related data.
Define an operator?
An operator is a character that performs a task in our code.
What is an arithmetic operator?
Built-in arithmetic operators allow us to perform mathematical calculations on numbers.