JavaScript Comparisons
We know many comparison operators from maths. In JavaScript they are written like this: Greater/less than: a > b, a < b. Greater/less than or equals: a >= […]
We know many comparison operators from maths. In JavaScript they are written like this: Greater/less than: a > b, a < b. Greater/less than or equals: a >= […]
We know many operators from school. They are things like addition +, multiplication *, subtraction -, and so on. In this chapter, we’ll start with simple operators, then […]
Most of the time, operators and functions automatically convert the values given to them to the right type. For example, alert automatically converts any value to a […]
As we’ll be using the browser as our demo environment, let’s see a couple of functions to interact with the user: alert, prompt and confirm. 1. alert This one […]
A value in JavaScript is always of a certain type. For example, a string or a number. There are eight basic data types in JavaScript. […]
Most of the time, a JavaScript application needs to work with information. Here are two examples: An online shop – the information might include goods […]
For a long time, JavaScript evolved without compatibility issues. New features were added to the language while old functionality didn’t change. That had the benefit […]
The first thing we’ll study is the building blocks of code. 1. Statements Statements are syntax constructs and commands that perform actions. We’ve already seen […]
This part of the tutorial is about core JavaScript, the language itself. But we need a working environment to run our scripts and, since this […]
Code is prone to errors. You will quite likely make errors… Oh, what am I talking about? You are absolutely going to make errors, at least if […]
A code editor is the place where programmers spend most of their time. There are two main types of code editors: IDEs and lightweight editors. […]
This book is a tutorial. It aims to help you gradually learn the language. But once you’re familiar with the basics, you’ll need other sources. 1. […]
Let’s see what’s so special about JavaScript, what we can achieve with it, and what other technologies play well with it. 1. What is JavaScript? […]
1. Stern-Brocot tree The Stern-Brocot tree is an elegant construction to represent the set of all positive fractions. It was independently discovered by German mathematician […]
This game is played on a $4 \times 4$ board. On this board there are $15$ playing tiles numbered from 1 to 15. One cell […]
1. Statement We are given the natural numbers $n$ and $k$. All natural numbers from $1$ to $n$ are written in a circle. First, count […]
Suppose, we have a set of jobs, and we are aware of every job’s deadline and its duration. The execution of a job cannot be […]
This task is about finding an optimal schedule for $n$ jobs on two machines. Every item must first be processed on the first machine, and […]
This task is about finding an optimal schedule for $n$ jobs on a single machine, if the job $i$ can be processed in $t_i$ time, […]
1. Introduction This theorem describes the so-called impartial two-player game, i.e. those in which the available moves and winning/losing depends only on the state of the game. […]