Paste Search Dynamic
Recent pastes
listOf
  1. // = vs == vs ===
  2. // = is an assignment
  3.  
  4. sale = "Full Name";
  5.  
  6. if(sale = 2){
  7.   console.log("We Made 1 sale hooray!");
  8.  
  9. }
  10.  
  11.  
  12. const listOfGroceries = [
  13.   'coffee',
  14.   'blueberries',
  15.   'italian sausage',
  16.   'sourdough bread',
  17. ];
  18.  
  19. console.log(listOfGroceries.slice(0, 6));
  20.  
  21.  
  22. let spaceship = {
  23.   "crew members":8,
  24.   "fuel type": "jet",
  25. };
  26.  
  27. console.log(spaceship["crew members"]);
  28. console.log(spaceship);
  29.  
  30.  
  31. spaceship = {
  32.   "supplies": ["food and water", "medical","survival tools"],
  33.   "equipment": ["space suits", "medial chamber"]
  34. };
  35.  
  36. console.log(spaceship);
  37.  
  38.  
  39. let spaceship2 = {
  40.   crew: {
  41.     captain: {
  42.       name: 'Lily',
  43.       degree: 'Computer Engineering',
  44.       cheerTeam() { console.log('You got this!') }
  45.     },
  46.     'chief officer': {
  47.       name: 'Dan',
  48.       degree: 'Aerospace Engineering',
  49.       agree() { console.log('I agree, captain!') }
  50.     },
  51.     medic: {
  52.       name: 'Clementine',
  53.       degree: 'Physics',
  54.       announce() { console.log(`Jets on!`) } },
  55.     translator: {
  56.       name: 'Shauna',
  57.       degree: 'Conservation Science',
  58.       powerFuel() { console.log('The tank is full!') }
  59.     }
  60.   }
  61. };
  62.  
  63. // for...in
  64. for (let crewMember in spaceship2.crew) {
  65.   console.log(`${crewMember}: ${spaceship2.crew[crewMember].name}`);
  66. }
  67.  
  68.  
Parsed in 0.007 seconds