Java Script Introduction Flashcards

1
Q

The method used to log or print messages to

the console. It can also be used to print objects and other info.

A

console.log()
Example console.log(‘Hi there!’);
// Prints: Hi there!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A programming language that powers the dynamic
behavior on most websites. Alongside HTML and CSS, it is a
core technology that makes the web run.

A

JavaScript

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

term used to return information about an object, and are called by
appending an instance with a period . , the ___? name,
and parentheses.

A

Methods
Example
// Returns a number between 0 and 1
Math.random();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Libraries

A

contain methods that can be called by appending the
library name with a period . , the method name, and a set of
parentheses.
Math.random();
// Math is the library

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

are a primitive data type. They include the set of all

integers and 􀀁oating point numbers.

A
numbers
let amount = 6;
let price = 4.99;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The ____? property of a string returns the number of

characters that make up the string.

A
String .length
Example
let message = 'good nite';
console.log(message.length);
// Prints: 9
console.log('howdy'.length);
// Prints: 5
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Term Data Instances ?

A

When a new piece of data is introduced into a JavaScript program, the program keeps track of it in an instance of that
data type. An instance is an individual case of a data type.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

a primitive data type. They can be either true or false . Are called?

A

Booleans

Example
let lateToWork = true;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

A function returns a floating-point, random

number in the range from 0 (inclusive) up to but not including

A
The Math.random() 
Example
console.log(Math.random());
// Prints: 0 - 0.9
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A function that returns the largest integer less than

or equal to the given number.

A

The Math.floor()
Example
console.log(Math.floor(5.95));
// Prints: 5

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

In JavaScript, single-line comments are created with ?

A

two consecutive forward slashes // .
Example
// This line will denote a comment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A primitive data type. It represents the intentional absence of value.

A

null
Example
let x = null;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

A primitive data type. They are any grouping of primitive data type. They are any grouping of characters (letters, spaces, numbers, or symbols) surrounded by single quotes ‘ or double quotes “ . Is called a

A

Strings
Example
let single = ‘Wheres my bandit hat?’;
let double = “Wheres my bandit hat?”;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

JavaScript supports arithmetic operators for:

Addition Subtraction Multiplication Division

A
// Addition
5 + 5
// Subtraction
10 - 5
// Multiplication
5 * 10
// Division
10 / 5
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

JavaScript supports arithmetic operator that returns

the remainder or signed remainder of a division,

A

Examples
// Modulo
10 % 5

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

In JavaScript, multi-line comments are created by surrounding
the lines with __? at the beginning and __? at the end.

A

In JavaScript, multi-line comments are created by surrounding
the lines with /* at the beginning and / at the end.
Comments are good ways for a variety of reasons like
explaining a code block or indicating some hints, etc.
Example
/

The below configuration must be
changed before deployment.
*/
let baseUrl = ‘localhost/taxwebapp/country’;

17
Q

_______? returns the number that remains after the right-hand number divides into the left-hand number as many times as it evenly can.

A

Remainder / Modulo Operator
The remainder operator, sometimes called modulo, returns the number that remains after the right-hand number divides into the left-hand number as many times as it evenly can.
Example
// calculates the number of days left over after 365 is divided by 7
const daysLeftOver = 365 % 7 ;
console.log(“A year has “ + daysLeftOver + “ days”);

18
Q

There are 7 fundamental data types in JavaScript

A

strings, numbers, booleans, null, undefined, symbol, and object.

19
Q

____?, including instances of data types, can have properties, stored information. The properties are denoted with a . after the name of the object, for example: ‘Hello’.length.

A

Objects, including instances of data types, can have properties, stored information. The properties are denoted with a . after the name of the object, for example: ‘Hello’.length.

20
Q

Objects including instances of data types, can have ____? which perform actions. ____? are called by appending the object or instance with a period, the _____? name, and ____. For example: ‘hello’.toUpperCase().

A

Objects including instances of data types, can have methods which perform actions. Methods are called by appending the object or instance with a period, the method name, and parentheses. For example: ‘hello’.toUpperCase().

21
Q

We can access ___? and _____? by using the ., dot operator.

A

We can access properties and methods by using the ., dot operator.

22
Q

____?, including Math, are collections of methods and properties that JavaScript provides.

A

Built-in objects, including Math, are collections of methods and properties that JavaScript provides.