Introduction Flashcards
What does console.log() ?
Data is printed, or logged, to the console, a panel that displays messages
How do you comment one line?
We can write single-line comments with//
How do you comment more than one line?
We can write multi-line comments between/*and/
What are the 7 fundamental data types in JavaScript ?
Strings, numbers, booleans, null, undefined, symbol, and object.
What is a string ?
Strings are characters wrapped in single or double quotes:’Sample String’
What are the built-in arithmetic operators ?
The built-in arithmetic operators include+,,,/, and%
What are the two things that objects can have ?
Properties & Method
What is a method?
Methodsare actions we can perform. Data types have access to specific methods that allow us to handle instances of that data type.
How do you call(or use) a method?
With :
- a period (the dot operator)
- the name of the method
- opening and closing parentheses
E.g.'example string'.methodName()
.
How is denoted a property on an object ?
The properties are denoted with a.after the name of the object, for example:’Hello’.length.
What is the data type object ?
Collections of related data.
What is the data type symbol ?
A newer feature to the language, symbols are unique identifiers, useful in more complex coding. No need to worry about these for now.
What is the data type undefined?
This data type is denoted by the keywordundefined(without quotes). It also represents the absence of a value though it has a different use thannull.undefinedmeans that a given value does not exist.
What is the data type Null?
Null: This data type represents the intentional absence of a value, and is represented by the keywordnull(without quotes).
What is the data type Boolean?
Boolean: This data type only has two possible values— eithertrue
orfalse
(without quotes). It’s helpful to think of booleans as on and off switches or as the answers to a “yes” or “no” question.