Guest User

Untitled

a guest
Oct 22nd, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. 1 -> 2 -> 3 -> 4 -> 5
  2.  
  3. {
  4. value: 1,
  5. next: {
  6. value: 2,
  7. next: {
  8. value: 3,
  9. next: {...}
  10. }
  11. }
  12. }
  13.  
  14. let array = [];
  15. array.push({ type: "banana", price: 70 });
  16. array.push({ type: "apple", price: 100 });
  17.  
  18. let banana = array.find( item => item.type === "banana" );
  19. console.log( banana );
  20.  
  21. console.log( array.sort( ( a, b ) => a.price < b.price ) );
Add Comment
Please, Sign In to add comment