Q
Q
qo_0p2016-02-02 11:21:25
JavaScript
qo_0p, 2016-02-02 11:21:25

Is it possible to pass two identical parameters to a function at the same time?

Faced such a task, you need to write a function for modal windows and alerts. Which should be called like this:

obj.modal ({
  type: "content",
title: "test",
body: "some text",
button: { title="Close" class="btn btn-primary" data-dismiss="modal" onclick="test()" },
button: { title="Cancel" class="btn btn-primary" data-dismiss="modal" },
onclose: "closeFunction(data);"
});

As you can see, there can be several buttons.
But then I don't understand! A function takes an object as a parameter, but can an object have 2 identical parameters?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey, 2016-02-02
@VladimirAndreev

An object cannot have 2 identical parameters.
probably meant:
buttons: {
"close": {},
"cancel": {}
]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question