Please enable JavaScript.
Coggle requires JavaScript to display documents.
Programming (Code (Iterations (loops) (WHILE loop (var a = 1;
while (a…
Programming
Code
Conditional Code — Code that sometimes run and sometimes don't depending on the conditions on the program at that time. Conditional Expressions (Branches)
-
The SWITCH (select / select case) statement — conditional statement that permits enumeration of discrete cases, instead of relying on Boolean expressions
switch ( var ) {
case value1:
action1;
break;
case value2:
action2;
break;
case value3:
action3;
break;
default:
action if false;
}
Modular Code
Functions
Modules, Subroutines, Subprograms, Routines, Methods
It is simply the idea of taking a block of code, wrapping it up, and giving it a name so that you can call it later. And you treat this block of code as one thing
To create a function we take the code that we want to enclose and surround it with braces to create a Code Block. And whatever is inside that code block is called the Body of the Function.
-
-
Example: alert("Hello, world!");
Calling a build-in alert function, passing in a parameter
Iterations (loops)
-
off-by-one error (oboe), also commonly known as an off-by-one bug (obob) — is a logic error involving the discrete equivalent of a boundary condition. Often occurs in programming when iterative loop iterates one time too many or too few
-
-
-
-
Source Code
-
Source Code (Исходный код) — any collection of computer instructions (possibly with comments), written using a human-readable language
Operators
-
Types of operators
Arithmetic 1
-
-
-
-
%
modulus operator — gives us the remainder (остаток) when the number on the left of the operator is divided by by the number on the right
-
-
-
Comparison
-
-
-
-
-
Logical AND / OR
a === b && c === d (and)
true if and only if both operands are true, otherwise false
a === b || c === d (or)
true if and only if at least one operand is true, otherwise false
-
-
Variables (Переменные)
Creating variable, we defining a container to hold a value or data
Types of Data
-
-
Single Character
сhar in C, must be in 'single quotes'
Always take up 1 byte of memory (8 bits). This means the range of values they can store is necessarily limited to 8 bits worth of information
-
-
-
void is a type, but not data type
Functions can have a void return type, which just means they don't return a value
-
-
Arrays
-
Creating Array
var multipleValues = []; multipleValues[0] = 50; multipleValues[1] = 10; multipleValues[2] = "Hello";
var multipleValues = [ 50,10,"Hello" ];
-
Properties
.length
length is 3 (there are 3 elements in it), but the highest index is 4
-
Arrays Size
Mutable Object
It can mutate, change (JavaScript)
-
Associative Array (Dictionary, Map, Table)
Variable Scope
Defines where the variable is visible, who can see it and who can use it
-
-
What is programming?
-
It's breaking apart a more complex idea, a more complex task, into its smallest individual instructions and then using a programming language to write those instructions
Debugging
- The process of finding and resolving of defects or problem within the program that prevent correct operation of computer software or a system.
- Debugging tactics can involve interactive debugging, control flow analysis, unit testing, integration testing, log file analysis, monitoring at the application or system level, memory dumps, and profiling.