Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. {viewContas && viewContas.map(vc => {
  2. if(auth === vc.authorId)
  3. return (
  4. <tr key={vc.id}>
  5. <td>{vc.data}</td>
  6. <td>{vc.desc}</td>
  7. <td>R${vc.price}</td>
  8. <td>
  9.  
  10. let data = [
  11. {data: 1/1, desc: 'conta de gás', price: 138},
  12. {data: 1/1, desc: 'conta de gás', price: 139},
  13. {data: 1/1, desc: 'conta de gás', price: 140},
  14. ]
  15.  
  16. let prices = data.map( (v,i) => {
  17. return v.price;
  18. })
  19.  
  20. console.log( prices.reduce( (a,b) => {
  21. return a+b;
  22. }) );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement