Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Домашнее задание 2 #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Домашнее задание 2 #1

wants to merge 2 commits into from

Conversation

RooshRoosh
Copy link

No description provided.

*
*/

function Event(Call, DateStart, DateFinish, Description, Parent, Childs, Comments, Peoples, Location, Private, Rank, EvRS, Link) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Именая переменных принято называть с маленькой буквы. Тебе не кажется, что параметров слишком много? Подумай как можно сделать твой код более читемым.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В Python можно писать что-то в духе "def func( **kwargs):", где kwargs словарь с парами "переменная: значение". Тут видимо как-то аналогично, нет?
Видимо качестве "словаря" используем объект с аналогичными парами. В самой функции проверяем наличие полей, если поле присутствует, то оставляем значение, если нет то значение по умолчанию.

function Event( eventvars ) {} ? // evemtvars = { Call = "Событие", Description="Новое событие", Private=false}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Да, так подойдет. #2 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants