P
P
Partizanin2015-10-13 16:32:27
JavaScript
Partizanin, 2015-10-13 16:32:27

Why, after passing a parameter to a method, does it cease to be an object and become a string?

Before passing a parameter to a method, it is displayed as an object

jsonData
Object {id: "UAH", optionsCourse: Array[17], optionsValute: Array[5], rows: Array[4]}


after this parameter was passed to another method, it became a string
data
"InnerExchange{id='UAHEUR', bankName='null', buyCourse=0.0411, sellCourse=0.0406}"


here you can see the result of the robots of the program using the F12 console ,
and here you can see the source codes

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladislav, 2015-10-13
@Div100

And where is the code itself, in which the communication of these methods actually takes place?
Try to do JSON.parse() when receiving
when passing JSON.stringify()

D
Dasha Tsiklauri, 2015-10-14
@dasha_programmist

Look carefully! you are passing not data, but data.rows[i], that is, an array element that is inside data, you initially have string stored there!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question