0 points

return 2 objects from function typescript Code Example


dashboard

Sun Nov 29 2020 14:36:26 GMT+0000 (UTC)

Posted by @ali_alaraby #undefined

//function that returns multiple values

function getTopTwoColors() {

    return ["blue", "pink"];

}

var topTwoColors=getTopTwoColors();

var firstValue=topTwoColors[0]; //get first return value

var secondValue=topTwoColors[1]; //get second return value
content_copy Copy

https://www.codegrepper.com/code-examples/delphi/return+2+objects+from+function+typescript