Skip to content

Instantly share code, notes, and snippets.

@Jorger
Created February 12, 2016 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jorger/4ccafe7beadab3e66b69 to your computer and use it in GitHub Desktop.
Save Jorger/4ccafe7beadab3e66b69 to your computer and use it in GitHub Desktop.
var a = [1,2,3,4,5];
var expresion = true;
var resultado = expresion ? (function()
{
var valores = [];
for(var i = 0; i < a.length; i++)
{
valores.push(a[i]);
}
return valores;
})() : [];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment