Home  >  Article  >  Web Front-end  >  js method implementation code that returns multiple data_javascript skills

js method implementation code that returns multiple data_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:53:351098browse
Copy code The code is as follows:

//Return multiple data methods
function getPos(){
var xx = "xx";
alter(xx);
var yy = "yy";
return{x:xx,y:yy};
}
/ /Call
function getXY(){
var ret = getPos();
alert(ret.x);
alert(ret.y);
}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn