D
D
Daniil Igorevich2015-12-17 22:45:49
Programming
Daniil Igorevich, 2015-12-17 22:45:49

How to read such syntax correctly?

Where can I read the rules for composing and correctly reading such syntax?
2523af3c269942e6b5bffac491eb561b.png

Answer the question

In order to leave comments, you need to log in

4 answer(s)
K
Kirill Nesmeyanov, 2015-12-17
@SerafimArts

In my opinion, this is a generally accepted syntax, I won’t tell you where to look, but optional arguments to functions are always indicated in square brackets.
There are other similar options:

arr.map(Function callback[, Object context = null])
//
функция(Тип имя[, Тип имя = значение_по_умолчанию])

A
abcd0x00, 2015-12-18
@abcd0x00

Decent documentation should describe this syntax at the beginning. (If it was written by a person familiar with mathematics.)

K
Konstantin, 2015-12-18
@Drakonn

what is not clear? there is an instance of the array class - arr, which has a sort method that accepts a sort method, chosen either from the available ones (read in the documentation), or from self-written

V
vad1mi, 2015-12-20
@vad1mi

An optional argument to define the sort key, mostly relevant when sorting structures with multiple parameters. For example points on x or y .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question