JS and jQuery are useful when trying to make an interactive webpage. It is helpful to understand how to use these when learning about webpage development!
Epicodus created one reference that helped guide this page. Please see this page for the reference. Additionally MDN is a helpful website that was referred when describing the flashcards.Let's learn some concepts! We have a total of 19 key words.
Click the following words to see the definitions and practice memorizing and understanding the words/defntions!
JavaScript is a programming language for the Web. It can update and change both HTML and CSS. It can also calculate, manipulate, and validate data.
An operator operator performs some operation on single or multiple operands (data value) and produces a result. For example 1 + 2, where + sign is an operator and 1 is left operand and 2 is right operand. + operator adds two numeric values and produces a result which is 3 in this case.
JavaScript variables are containers for storing data values.
Variable naming conventions are very important in JavaScript. This naming convention is called lower camel case because the lower and upper case letters look a little like the humps on a camel. (There are other camel case naming conventions such as upper camel case, too, which will learn about when they are needed.). An example is
A JavaScript function is a block of code designed to perform a particular task. A JavaScript function is executed when "something" invokes it (calls it).
A method is a kind of function that is called on something. It is a function that is a property of an object. The example below would change the string to uppercase.
Arguments are passed into the parentheses (). It's not required for a method to have arguments. Some take no arguments, some take optional arguments, and some take one or even many arguments.
In the example below, "This is a string" is the receiver, concat is the method, and "!!!" is the argument we pass into the method. As we can see, String.prototype.concat() takes the argument (in this case "!!!") and attaches it to the receiver ("This is a string!!!")
A parameter is a placeholder for an argument. We use parameters when we declare functions and methods. We'll learn more about declaring functions when we actually start creating our own custom functions soon.
Below, in function addEmphasis(string), string is a parameter. That means it's a placeholder for a variable. It has no value yet. Once we pass an argument into the parameter, the parameter takes on the value of the argument. If, for some reason, we forget to pass an argument into a parameter, that parameter's value will be undefined.
The return statement ends function execution and specifies a value to be returned to the function caller.
Methods can be chained. This means you can add methods to each other after typing one out. In the example below, we chain concat and uppercase methods.
String: a JavaScript data type that represents the exact text of whatever is enclosed in the quotes.
Boolean: A boolean can be one of two values: true or false. That's it. We will use these a lot, too, and we will cover these in detail next week.
The global undefined property represents the primitive value undefined. It is one of JavaScript's primitive types. A variable that has not been assigned a value is of type undefined. A method or statement also returns undefined if the variable that is being evaluated does not have an assigned value. A function returns undefined if a value was not returned.
NaN is a property of the global object. In other words, it is a variable in global scope.
The initial value of NaN is Not-A-Number — the same as the value of Number.NaN. In modern browsers, NaN is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. It is rather rare to use NaN in a program
The value null is written with a literal: null. null is not an identifier for a property of the global object, like undefined can be. Instead, null expresses a lack of identification, indicating that a variable points to no object. In APIs, null is often retrieved in a place where an object can be expected but no object is relevant.
alert() is a function. A function is something that performs an action. Just like a method, a function can take an argument. The alert() function pops up a dialog box with the string that you pass in as an argument.
A comment is used to add explanatory notes to the code or to prevent the browser from interpreting specific parts of the style sheet. By design, comments have no effect on the layout of a document.
jQuery is a JavaScript Library that focuses on simplifying DOM manipulation, AJAX calls, and Event handling.
jQuery uses a format, $(selector).action() to assign an element(s) to an event. To explain it in detail, $(selector) will call jQuery to select selector element(s), and assign it to an event API called .action().
An attribute defines the source of what you are trying to reference. Quotation marks must always be added to an attribute. Any information about the attribute is included inside the quotation marks.