4. Adding Interactivity with JavaScript Flashcards
Powerful programming language that provides significant value in web development
add interactivity to websites
JavaScript
Server-side JavaScript development
Node.js
Scripts run directly within your users’ browsers
Client-side interactivity
Responsive and interactive user
interfaces
Broad API and third-party service integration that permit
multi-tier applications
Development through frameworks like React Native and Iconic
Cross-platform mobile app development
Vast ecosystem of libraries, frameworks and tools
Near-universal browser support
JavaScript can be included in your web pages by referencing an external .js file as an attribute of the
<script> tag </script>
You can drop your JavaScript code between the
tags in the
Header section of your HTML
Since the adoption of “___________” you no longer need to add the text/javascript as an attribute of the
tag.
HTML5
JavaScript is the default scripting language for
HTML
Comments accomplished by
//
Character concatenates all values in sentence
+
To get to command line
F12
right click browser and select INSPECT
Representation of the page code
Elements tab
Live JavaScript environment
Console
Built-in JavaScript function that allows you to output messages or values to the console.
console.log()
Primary tool for storing and processing data and is a location in memory that’s identified in your code by a name - more descriptive the better
variable
Similar to a variable in that it’s also a named storage location but it represents a value that can’t be reassigned or changed once it is assigned.
ie - lastname
constant
data meant to be read literally and not treated as say numbers
string
value of either true or false
boolean
Another way of saying that some variables can be valid more widely than others.
Block Scope
Variable values can be accessed from any place and at any level of a program
global
Variable values are available only within a limited block of code
local
A method for hanging the execution of specific code on the status of a condition.
If block
Ordered collection of multiple values listed within square brackets
best for ordered lists of elements
arrays