JavaScript Comparisons

2021 VietMX 0

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 >= […]

JavaScript Type Conversions

2021 VietMX 0

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 […]

JavaScript Variables

2021 VietMX 0

Most of the time, a JavaScript application needs to work with information. Here are two examples: An online shop – the information might include goods […]

JavaScript Code structure

2021 VietMX 0

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 […]

Josephus Problem

2021 VietMX 0

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 […]

Sprague-Grundy theorem

2021 VietMX 0

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. […]