Basic JavaScript

Ace your homework & exams now with Quizwiz!

In programming, text values are called BLANK

In programming, text values are called text strings.

What are Variables?

Variables are containers for storing data (storing data values). In this example, x, y, and z, are variables, declared with the var keyword: Example var x = 5;var y = 6;var z = x + y;

JavaScript can handle many types of data, but for now, just think of the main two BLANK and BLANK .

JavaScript can handle many types of data, but for now, just think of numbers and strings. the rest are... JavaScript provides eight different data types which are null, object, bigint, symbol, boolean, undefined, number, string, NOBS BUNS

Introduction to JavaScript

JavaScript is a high-level programming language that all modern web browsers support. It is also one of the core technologies of the web, along with HTML and CSS that you may have learned previously. This section will cover basic JavaScript programming concepts, which range from variables and arithmetic to objects and loops.

what are the three core technologies of the web?

JavaScript is one of the core technologies of the web, along with HTML and CSS

what are the three core technologies of the web? describe what each does.

JavaScript is one of the core technologies of the web, along with HTML and CSS. HTML to define the content of the web. CSS - to specify the layout of web pages. JavaScript - to program the behaviour of the web pages.

BLANK is the act of constructing a program

Programming is the act of constructing a program

BLANK provides an environment for programming JavaScript outside of the browser.

Several platforms for desktop and server programming, most notably the Node.js project (the subject of Chapter 20), provide an environment for programming JavaScript outside of the browser.

name 4 Ways to Declare a JavaScript Variable:

4 Ways to Declare a JavaScript Variable: Using var Using let Using const Using nothing

A JavaScript BLANK is a block of JavaScript code, that can be executed when "called" for. For example, a BLANK can be called when an event occurs, like when the user clicks a button.

A JavaScript function is a block of JavaScript code, that can be executed when "called" for. For example, a function can be called when an event occurs, like when the user clicks a button.

A BLANK is a set of precise instructions telling a computer what to do.

A Program is a set of precise instructions telling a computer what to do. Programming is the act of constructing a program

What is an expression?

A fragment of code that produces a value is called an expression. an expression corresponds to a sentence fragment. a JavaScript statement corresponds to a full sentence. A program is a list of statements.

A fragment of code that produces a value is called an BLANK.

A fragment of code that produces a value is called an expression. an expression corresponds to a sentence fragment. a JavaScript statement corresponds to a full sentence. A program is a list of statements.

a JavaScript BLANK corresponds to a full sentence. A program is a list of BLANK .

A fragment of code that produces a value is called an expression. an expression corresponds to a sentence fragment. a JavaScript statement corresponds to a full sentence. A program is a list of statements. The simplest kind of statement is an expression with a semicolon after it. This is a program: 1; !false;

A BLANK is a block of Javascript code, that can be executed when "called" for.

A function is a block of Javascript code, that can be executed when "called" for.

What is a Function?

A function is a block of Javascript code, that can be executed when "called" for. For example, a function can be call when an event occurs, like when the user clicks a button.

In computer science, data is anything that is meaningful to the computer. JavaScript provides eight different data types which are...

In computer science, data is anything that is meaningful to the computer. JavaScript provides eight different data types which are undefined, null, boolean, string, symbol, bigint, number, and object.

Inside the computer's world, there is only data. You can read data, modify data, create new data—but that which isn't data cannot be mentioned. All this data is stored as long sequences of BLANK and is thus fundamentally alike.

Inside the computer's world, there is only data. You can read data, modify data, create new data—but that which isn't data cannot be mentioned. All this data is stored as long sequences of bits and is thus fundamentally alike.

Using BLANK to prevent execution of code is suitable for code testing. Adding BLANK in front of a code line changes the code lines from an executable line to a comment.

Using comments to prevent execution of code is suitable for code testing. Adding // in front of a code line changes the code lines from an executable line to a comment.

Variable names can be made up of BLANK, BLANK, and BLANK or BLANK, but may not contain BLANK or start with a BLANK.

Variable names can be made up of numbers, letters, and $ or _, but may not contain spaces or start with a number.

BLANK allow computers to store and manipulate data in a dynamic fashion. They do this by using a "label" to point to the data rather than using the data itself. Any of the BLANK number data types may be stored in a variable.

Variables allow computers to store and manipulate data in a dynamic fashion. They do this by using a "label" to point to the data rather than using the data itself. Any of the eight data types may be stored in a variable.

Variables are BLANK for storing values.

Variables are containers for storing values.

We tell JavaScript to create or declare a variable by putting the keyword BLANK in front of it, like so:

We tell JavaScript to create or declare a variable by putting the keyword var in front of it, like so: var ourName;

Name two databases that use JavaScript as their scripting and query language.

Web browsers are not the only platforms on which JavaScript is used. Some databases, such as MongoDB and CouchDB, use JavaScript as their scripting and query language

When should you Use JavaScript const?

When to Use JavaScript const? If you want a general rule: always declare variables with const. If you think the value of the variable can change, use let In this example, price1, price2, and total, are variables: Example const price1 = 5;const price2 = 6;let total = price1 + price2;

When to use JavaScript const?

When to use JavaScript const? As a general rule, always declare a variable with const unless you know that the value will change. Use const when you declare: A new Array A new Object A new Function A new RegExp The keyword const is a little misleading. It does not define a constant value. It defines a constant reference to a value.

Words with a special meaning, such as let, are BLANK, and they may not be used as binding (variables, identifiers) names.

Words with a special meaning, such as let, are keywords, and they may not be used as binding names. The full list of keywords and reserved words is rather long... break case catch class const continue debugger default delete do else enum export extends false finally for function if implements import interface in instanceof let new package private protected public return static super switch this throw true try typeof var void while with yield

computers distinguish between BLANK, such as the number 12, and BLANK, such as "12", "dog", or "123 cats", which are collections of BLANK.

computers distinguish between numbers, such as the number 12, and strings, such as "12", "dog", or "123 cats", which are collections of characters.

Blank is built into every modern web browser.

javaScript is built into every modern web browser.

In a programming language, BLANK are used to store data values.

In a programming language, variables are used to store data values. JavaScript uses the keywords var, let and const to declare variables. An equal sign is used to assign values to variables.

JavaScript uses the keywords var, let and const to BLANK variables.

In a programming language, variables are used to store data values. JavaScript uses the keywords var, let and const to declare variables. An equal sign is used to assign values to variables.

A BLANK is a piece of program wrapped in a value. Such values can be applied in order to run the wrapped program.

A function is a piece of program wrapped in a value. Such values can be applied in order to run the wrapped program. Executing a function is called invoking, calling, or applying it. You can call a function by putting parentheses after an expression that produces a function value. Values given to functions are called arguments. Different functions might need a different number or different types of arguments. When a function produces a value, it is said to return that value.

what is a Function?

A function is a piece of program wrapped in a value. Such values can be applied in order to run the wrapped program. Executing a function is called invoking, calling, or applying it. You can call a function by putting parentheses after an expression that produces a function value. Values given to functions are called arguments. Different functions might need a different number or different types of arguments. When a function produces a value, it is said to return that value.

A BLANK can ingeniously combine an enormous number of simple actions to do very complicated things.

A program can ingeniously combine an enormous number of simple actions to do very complicated things.

A BLANK is a artificial constructed language to instruct computers.

A programming language is a artificial constructed language to instruct computers.

What is a programming language?

A programming language is a artificial constructed language to instruct computers.

All JavaScript variables must be identified with unique names. These unique names are called BLANK.

All JavaScript variables must be identified with unique names. These unique names are called identifiers. Identifiers can be short names (like x and y) or more descriptive names (age, sum, totalVolume). The general rules for constructing names for variables (unique identifiers) are: Names can contain letters, digits, underscores, and dollar signs. Names must begin with a letter Names can also begin with $ and _ (but we will not use it in this tutorial) Names are case sensitive (y and Y are different variables) Reserved words (like JavaScript keywords) cannot be used as names

Always declare JavaScript variables with BLANK, BLANK or BLANK

Always declare JavaScript variables with var,let, or const. The var keyword is used in all JavaScript code from 1995 to 2015. The let and const keywords were added to JavaScript in 2015. If you want your code to run in older browser, you must use var.

An expression is a combination of values, variables, and operators, which computes to a BLANK.

An expression is a combination of values, variables, and operators, which computes to a value. The computation is called an evaluation. For example, 5 * 10 evaluates to 50:

Difference between an expression and a statement.

An expression is a combination of values, variables, and operators, which computes to a value. The computation is called an evaluation. For example, 5 * 10 evaluates to 50: JavaScript statements are composed of: Values, Operators, Expressions, Keywords, and Comments.

At their most basic, BLANK are just collections of key-value pairs.

At their most basic, objects are just collections of key-value pairs. In other words, they are pieces of data (values) mapped to unique identifiers called properties (keys). Take a look at an example: const tekkenCharacter = { player: 'Hwoarang', fightingStyle: 'Tae Kwon Doe', human: true };

Because computers are dumb, pedantic beasts, programming is fundamentally what?

Because computers are dumb, pedantic beasts, programming is fundamentally tedious and frustrating.

BLANK are any kind of two-valued things, usually described as zeros and ones. Inside the computer, they take forms such as a high or low electrical charge, a strong or weak signal, or a shiny or dull spot on the surface of a CD. Any piece of discrete information can be reduced to a sequence of zeros and ones and thus represented in bits.

Bits are any kind of two-valued things, usually described as zeros and ones. Inside the computer, they take forms such as a high or low electrical charge, a strong or weak signal, or a shiny or dull spot on the surface of a CD. Any piece of discrete information can be reduced to a sequence of zeros and ones and thus represented in bits.

What is the text that make up programs?

Code is the text that make up programs?

BLANK are lines of code that JavaScript will intentionally ignore. BLANK are a great way to leave notes to yourself and to other people who will later need to figure out what that code does.

Comments are lines of code that JavaScript will intentionally ignore. Comments are a great way to leave notes to yourself and to other people who will later need to figure out what that code does.

BLANK a variable in JavaScript is called "declaring" a variable.

Creating a variable in JavaScript is called "declaring" a variable. You declare a JavaScript variable with the var or the let keyword: var carName; or:let carName; After the declaration, the variable has no value (technically it is undefined). To assign a value to the variable, use the equal sign: carName = "Volvo"; You can also assign a value to the variable when you declare it: let carName = "Volvo";

Creating a variable in JavaScript is called "BLANK " a variable.

Creating a variable in JavaScript is called "declaring" a variable. You declare a JavaScript variable with the var or the let keyword: var carName; or:let carName; After the declaration, the variable has no value (technically it is undefined). To assign a value to the variable, use the equal sign: carName = "Volvo"; You can also assign a value to the variable when you declare it: let carName = "Volvo";

ES6 introduced two important new JavaScript keywords: BLANK and BLANK . These two keywords provide Block Scope in JavaScript. Variables declared inside a { } block cannot be accessed from outside the block: Variables declared with the BLANK keyword can NOT have block scope. Variables declared inside a { } block can be accessed from outside the block.

ES6 introduced two important new JavaScript keywords: let and const. These two keywords provide Block Scope in JavaScript. Variables declared inside a { } block cannot be accessed from outside the block: Variables declared with the var keyword can NOT have block scope. Variables declared inside a { } block can be accessed from outside the block.

Every BLANK has a type that determines its role. Some BLANK are numbers, some BLANK are pieces of text, some values are functions, and so on.

Every value has a type that determines its role. Some values are numbers, some values are pieces of text, some values are functions, and so on.

For example, we can express the number 13 in Bits. Explain how this works?

For example, we can express the number 13 in bits. It works the same way as a decimal number, but instead of 10 different digits, you have only 2, and the weight of each increases by a factor of 2 from right to left. Here are the bits that make up the number 13, with the weights of the digits shown below them: 0 0 0 0 1 1 0 1 128 64 32 16 8 4 2 1 So that's the binary number 00001101. Its non-zero digits stand for 8, 4, and 1, and add up to 13.

BLANK are JavaScript names.

Identifiers are JavaScript names. Identifiers are used to name variables and keywords, and functions. The rules for legal names are the same in most programming languages. A JavaScript name must begin with: A letter (A-Z or a-z) A dollar sign ($) Or an underscore (_) Subsequent characters may be letters, digits, underscores, or dollar signs.

And 2 data types that cannot contain values: name them

In JavaScript there are 5 different data types that can contain values: Object String Number Boolean Function ############################### There are 6 types of objects: Object String Number Boolean Date Array ################################## And 2 data types that cannot contain values: null undefined

In JavaScript there are 5 different data types that can contain values: name them.

In JavaScript there are 5 different data types that can contain values: Object String Number Boolean Function ############################### There are 6 types of objects: Object String Number Boolean Date Array ################################## And 2 data types that cannot contain values: null undefined

There are 6 types of objects: name them

In JavaScript there are 5 different data types that can contain values: Object String Number Boolean Function ############################### There are 6 types of objects: Object String Number Boolean Date Array ################################## And 2 data types that cannot contain values: null undefined

In JavaScript we end statements with BLANK.

In JavaScript we end statements with semicolons. ;

In JavaScript, the equal sign (=) is an BLANK, not an BLANK operator.

In JavaScript, the equal sign (=) is an "assignment" operator, not an "equal to" operator. The "equal to" operator is written like == in JavaScript.

what is The Assignment Operator?

In JavaScript, the equal sign (=) is an "assignment" operator, not an "equal to" operator. The "equal to" operator is written like == in JavaScript.

An BLANK is used to assign values to variables.

In a programming language, variables are used to store data values. JavaScript uses the keywords var, let and const to declare variables. An equal sign is used to assign values to variables.

An equal sign is used to BLANK values to variables.

In a programming language, variables are used to store data values. JavaScript uses the keywords var, let and const to declare variables. An equal sign is used to assign values to variables.

An equal sign is used to assign BLANK to variables.

In a programming language, variables are used to store data values. JavaScript uses the keywords var, let and const to declare variables. An equal sign is used to assign values to variables.

JavaScript provides eight different "BLANK" aka "Values"

JavaScript provides eight different "data types" aka "Values" In computer science, data is anything that is meaningful to the computer. To be able to work with such quantities of bits without getting lost, we must separate them into chunks that represent pieces of information. In a JavaScript environment, those chunks are called values.

JavaScript provides eight different "data types" aka "BLANK"

JavaScript provides eight different "data types" aka "Values" In computer science, data is anything that is meaningful to the computer. To be able to work with such quantities of bits without getting lost, we must separate them into chunks that represent pieces of information. In a JavaScript environment, those chunks are called values.

JavaScript provides eight different data types, name all 8

JavaScript provides eight different data types which are null, object, bigint, symbol, boolean, undefined, number, string, NOBS BUNS (bold is in Chapter 1 in Eloquent JavaScript)

JavaScript statements are composed of: BLANK , BLANK , BLANK , BLANK , and BLANK .

JavaScript statements are composed of: Values, Operators, Expressions, Keywords, and Comments. Values (can be Constant or Variable) var x; const y; Operators + - * / Expressions are a combination of values, variables, and operators which compute to a value Keyword JavaScript statements often start with a keyword to identify the JavaScript action to be performed. JavaScript keywords are used to identify actions to be performed. Comments JavaScript comments can be used to explain JavaScript code, and to make it more readable.

JavaScript statements can be grouped together in BLANK, inside curly brackets {...}.

JavaScript statements can be grouped together in code blocks, inside curly brackets {...}. The purpose of code blocks is to define statements to be executed together. One place you will find statements grouped together in blocks, is in JavaScript functions:

JavaScript statements often start with a BLANK to identify the JavaScript action to be performed.

JavaScript statements often start with a keyword to identify the JavaScript action to be performed. Here is a list of some of the keywords you will learn about in this tutorial: var Declares a variable let Declares a block variable const Declares a block constant if Marks a block of statements to be executed on a condition switch Marks a block of statements to be executed in different cases for Marks a block of statements to be executed in a loop function Declares a function return Exits a function try Implements error handling to a block of statements

JavaScript uses an BLANK to assign values to variables:

JavaScript uses an assignment operator ( = ) to assign values to variables:

JavaScript uses an assignment operator ( = ) to BLANK values to variables:

JavaScript uses an assignment operator ( = ) to assign values to variables:

JavaScript uses arithmetic operators ( + - * / ) to BLANK values:

JavaScript uses arithmetic operators ( + - * / ) to compute values:

BLANK are text, written within double or single quotes:

Strings are text, written within double or single quotes:

The BLANK keyword was introduced in ES6 (2015). Variables defined with BLANK cannot be Redeclared. Variables defined with BLANK cannot be Reassigned. Variables defined with BLANK have Block Scope.

The const keyword was introduced in ES6 (2015). Variables defined with const cannot be Redeclared. Variables defined with const cannot be Reassigned. Variables defined with const have Block Scope.

The BLANK keyword was introduced in ES6 (2015). Variables defined with BLANK cannot be Redeclared. Variables defined with BLANK must be Declared before use. Variables defined with BLANK have Block Scope.

The let keyword was introduced in ES6 (2015). Variables defined with let cannot be Redeclared. Variables defined with let must be Declared before use. Variables defined with let have Block Scope. Variables defined with let cannot be redeclared. You cannot accidentally redeclare a variable. With let you can not do this: Example let x = "John Doe"; let x = 0; // SyntaxError: 'x' has already been declared With var you can: Example var x = "John Doe"; var x = 0;

The only way to become a clever programmer is...

The only way to become a clever programmer is to Practice!, Practice!, Practice! Code, Code, Code!!!

There are two ways to write comments in JavaScript:

There are two ways to write comments in JavaScript: " // This is an in-line comment. /* This is a multi-line comment */ "


Related study sets

7 ARTICLES OF THE US CONSTITUTION

View Set

The Art of Public Speaking - Chapter 9

View Set

Bio Exam 2 (Chpt. 6, 7, 8, & 10)

View Set