return 2 objects from function typescript Code Example

PHOTO EMBED

Sun Nov 29 2020 14:36:26 GMT+0000 (Coordinated Universal Time)

Saved 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_copyCOPY

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