1.Click for Expression reference
In Javascript:
"An expression is any valid unit of code that resolves to a value.
Conceptually, there are two types of expressions: those that assign a value to a variable and those that simply have a value. The expression x = 7 is an example of the first type. This expression uses the = operator to assign the value seven to the variable x. The expression itself evaluates to seven. The code 3 + 4 is an example of the second expression type. This expression uses the + operator to add three and four together without assigning the result, seven, to a variable.
JavaScript has the following expression categories:
Arithmetic: evaluates to a number, for example 3.14159. (Generally uses arithmetic operators.) String: evaluates to a character string, for example, âFredâ or â234â. (Generally uses string operators.) Logical: evaluates to true or false. (Often involves logical operators.) Object: evaluates to an object.
2.Click for Binding reference
Binding generally refers to a mapping of one thing to another. In the context of software libraries, bindings are wrapper libraries that bridge two programming languages, so that a library written for one language can be used in another language.
-
Environment
In computer program and software product development, the development environment is the set of processes and programming tools used to create the program or software product. The term may sometimes also imply the physical environment.
-
Function
In programming, a named section of a program that performs a specific task
-
Example of a funtion
Function encrypted() private {
creator = msg.sender;
}
-
What is a side effect?
In computer science, a function or expression is said to have a side effect if it modifies some state outside its scope or has an observable interaction with its calling functions or the outside world besides returning a value. For example, a particular function might modify a global variable or static variable, modify one of its arguments, raise an exception, write data to a display or file, read data, or call other side-effecting functions
-
value:
const square = function(x) {
return x*x;
};
console.log(square(10));
// - > 144
side effect:
const makeNoise = function() {
console.log(âPling!â);
};
MakeNoise();
//-> Pling
- control flow
When your program contains more than one statement, the statements are
executed as if they are a story, from top to bottom. This example program
has two statements. The first one asks the user for a number, and the second,
which is executed after the first, shows the square of that number.
let theNumber = Number(prompt(âPick a numberâ));
console.log("Your number is the square root of " +
theNumber * theNumber);
-
Not all programs are straight roads. We may, for example, want to create
a branching road, where the program takes the proper branch based on the
situation at hand. This is called conditional execution.
Conditional execution is created with the if keyword in JavaScript. In the
simple case, we want some code to be executed if, and only if, a certain condition
holds. We might, for example, want to show the square of the input only if the
input is actually a number.
let theNumber = Number(prompt(âPick a numberâ));
if (!Number.isNaN(theNumber)) {
console.log("Your number is the square root of " +
theNumber * theNumber);
}
-
the âifâ statement