Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menú<p id="demo" onclick="myFunction()">Click me to change my text color.</p>
<script>
function myFunction() {
document.getElementById("demo").style.color = "red";
}
</script>
const obj = [{id: 'a', time: 1}, {id: 'a', time: 2}, {id: 'b', time: 1}];
const objMapped = obj.reduce((acc, item) => {
let { id, time } = item;
acc[id] = acc[id] || [];
acc[id].push(time);
return acc;
}, {});
console.log(objMapped);
Citarconst obj = [{id: 'a', time: 1}, {id: 'a', time: 2}, {id: 'b', time: 1}];
const objMapped = obj.reduce((acc, item) => {
let { id, time } = item;
acc[id] = acc[id] || [];
acc[id].push(time);
return acc;
}, {});
console.log(objMapped);
Object.keys(obj).forEach(key => {
let value = obj[key]
})
var fabricar=function(obj){
// const obj = [{id: 'a', time: 1}, {id: 'a', time: 2}, {id: 'b', time: 1}];
console.log(obj);// muestra el array que mando
const objMapped = obj.reduce((acc, item) => {
let { id, time } = item;
acc[id] = acc[id] || [];
acc[id].push(time);
return acc;
}, []);
console.log(objMapped);
}
ror2.fabricar([{"id":65,"time":98},{"id":83,"time":170}]);
const objMapped = obj.reduce((acc, item) => {
let { id, time } = item;
acc[id] = acc[id] || [];
acc[id].push(time);
return acc;
}, []);
var ror2 = require('./node_modules/node-svm/sample/fabrica');
app.post('/servidor', function(req,res){
console.log(req.body.fact);// imprime bien el array [{"id":65,"time":98},{"id":83,"time":170}]
ror2.fabricar(req.body.fact);
});
var fabricar=function(obj){
// const obj = [{id: 'a', time: 1}, {id: 'a', time: 2}, {id: 'b', time: 1}];
console.log(obj);// muestra el array que mando
const objMapped = obj.reduce((acc, item) => {
let { id, time } = item;
acc[id] = acc[id] || [];
acc[id].push(time);
return acc;
}, []);
console.log(objMapped);
}
exports.fabricar=fabricar;