Skip to content

Instantly share code, notes, and snippets.

@f1729
Last active July 30, 2018 18:57
Show Gist options
  • Save f1729/b5122b57efd21b7e919d24acce0fba79 to your computer and use it in GitHub Desktop.
Save f1729/b5122b57efd21b7e919d24acce0fba79 to your computer and use it in GitHub Desktop.

RETO 2

const semaforo = {
  "colors": {
    "green": {
      "active": true
    },
    "yellow": {
      "active": false
    },
    "red": {
      "active": false
    }
  }
}

Programar un semaforo usando el objeto JSON. Mostrando cajas de los colores respectivos y además mostrar debajo de estas, el estado actual del objeto, por ejemplo, si el semaforo cambia a rojo se mostaria

{
  "colors": {
    "green": {
      "active": false
    },
    "yellow": {
      "active": false
    },
    "red": {
      "active": true
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment