a = [1, 1, 1, 1, 1, 2, 2, 2, 5, 5, 6]
a[1] += 1
#a = [1, 2, 1, 1, 1, 2, 2, 2, 5, 5, 6]
a[2] += 1
#a = [1, 2, 2, 1, 1, 2, 2, 2, 5, 5, 6]
a[2] += 1
#a = [1, 2, 3, 1, 1, 2, 2, 2, 5, 5, 6]
a[1] += 1
#a = [1, 3, 3, 1, 1, 2, 2, 2, 5, 5, 6]
a[1] += 1
#a = [1, 4, 3, 1, 1, 2, 2, 2, 5, 5, 6]
a[2] += 1
#a = [1, 4, 4, 1, 1, 2, 2, 2, 5, 5, 6]
function foo(name, surname, age) {
if (typeof surname == "number") {
age = surname;
surname = undefined;
}
// ...
}
foo("Ivan", "Ivanov", 23);
foo("Ivan", 23);