Skip to content

Instantly share code, notes, and snippets.

@YerlinMatu
Last active May 20, 2017 07:06
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 YerlinMatu/104cd9d3a59c0c2ed0fca91813c2f023 to your computer and use it in GitHub Desktop.
Save YerlinMatu/104cd9d3a59c0c2ed0fca91813c2f023 to your computer and use it in GitHub Desktop.
JSON Syntax
var Empleados = [
{
nombre: 'Jarry',
sueldo: 820
},
{
nombre: 'Tomas',
sueldo:789
},
{
nombre: 'Pedro',
sueldo: 659
},
{
nombre: 'Claudia',
sueldo: 345
}
];
var Sueldo2017 = Empleados.map((empleado)=> empleado.sueldo = (empleado.sueldo + 150) * 1000);
Empleados.sueldo = Sueldo2017;
for(let item of Empleados){
item.experiencia = Math.abs((item.sueldo / 7).toFixed());
}
var EmpleadosAPI = JSON.stringify(Empleados);
document.write(EmpleadosAPI);
<link href="https://cdnjs.cloudflare.com/ajax/libs/milligram/1.3.0/milligram.min.css" rel="stylesheet" />
@YerlinMatu
Copy link
Author

JSON Practical things

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment