Mindblown: a blog about philosophy.
-
Javascript Switch
The switch statement is used to represent various actions based on different conditions. It can replace multiple if checks and gives a more descriptive way for comparing a value with multiple variant. To perform a multiway branch, you can use multiple else…if statements, as in the previous chapter, but it is not the best way. It is better to use a switch statement…
-
Javascript Conditional Operators: if, ‘?’
There are five conditional statements in JavaScript: We use else if to identify a new condition to test, if the first condition is false; else if to identify a block of code to be executed, if a specified condition is true; else to identify a block of code to be executed, if the same condition is false; We use ‘?’ as shorthand for an if…else…
-
JavaScript Logical Operators
Logical operators are typically used to determine the logic between variables or values. They return a Boolean value of true or false depending on the evaluation. There are three logical operators in JavaScript: || (OR), && (AND), ! (NOT). They are called “logical”, but can be applied to values of any type, their result can also be of any type. || (OR) The OR operator is performed…
-
Comparison Operators
You know comparison operators from math class, but let’s refresh your knowledge: Greater than operator (a > b) returns true if the left operand is greater than the right operand. Syntax: Example of the greater than operator: Less than operator (a < b) returns true if the left operand is less than the right operand. Syntax: Example…
-
JavaScript Operators
JavaScript Operators We know many operators from school: addition +, multiplication *, subtraction -, and so on. In this chapter, we will talk about the aspects of operators that are not covered by school arithmetic. Terms: “unary”, “binary”, “operand” There is some terminology, which you should know before going on. An operand means what operators are applied to.…
-
Javascript Simple Actions alert, prompt, confirm
In this chapter of the tutorial you will get familiar with the browser functions. JavaScript has three kind of boxes: alert, prompt, confirm and console.log. Let’s talk about them in details. JavaScript Alert: Definition and Usage alert() method shows an alert dialog with the optional detailed content and an OK button. An alert box usually used in case we want to…
-
JavaScript Data Types
Data types JavaScript is a dynamic type language, which means that you don’t need to define type of the variable because it is effectively used by the JavaScript engine. There are two types of data in JavaScript: primitive data type and non-primitive (reference) data type. A variable in JavaScript contains any of these data types: strings, numbers, objects: Programming languages which allow…
-
JavaScript Variables
Variables in javaScript Variable means anything that can be changed anytime. A JavaScript variable is the name of storage location. Variables can be used to store goodies, visitors, and other data. Every programming language use variables. We use variables as symbolic names for values in an application. We can create variables using any of these…
-
JavaScript Use Strict
For a long time, JavaScript developed without any similarity issues. There were added some new attributes to the language, but old functionality didn’t change. That had the profit of never breaking existing code. But the negative aspect was that any mistake or some imperfect decision made by the creators of JavaScript got stuck in the…
-
Javascript with DOM
What is DOM The Document Object Model (DOM) is a way to represent a programming interface for HTML and XML documents. With the help of DOM we can gain and manipulate tags, classes using commands of Documents object. It gives an opportunity to connect programming languages to the page. DOM Document Web page is a document, which we can…
Got any book recommendations?