Giter VIP home page Giter VIP logo

jsobject's Introduction

const electronicProducts = {
  product1: {
    name: "Laptop",
    brand: "Apple",
    price: 1500,
    specifications: {
      processor: "Intel Core i7",
      memory: "16GB RAM",
      storage: "512GB SSD",
      ports: ["USB-C", "HDMI", "Thunderbolt"],
    },
    features: ["Retina Display", "Touch ID", "Backlit Keyboard"],
  },
  product2: {
    name: "Smartphone",
    brand: "Samsung",
    price: 1000,
    specifications: {
      screen: "6.5-inch AMOLED",
      camera: "Triple Camera Setup",
      battery: "4500mAh",
      colors: ["Black", "White", "Blue"],
    },
    features: ["Wireless Charging", "Water Resistant", "Face Recognition"],
  },
  product3: {
    name: "Smart TV",
    brand: "LG",
    price: 2000,
    specifications: {
      screen: "55-inch OLED",
      resolution: "4K Ultra HD",
      operatingSystem: "WebOS",
      sizeOptions: ["55-inch", "65-inch", "75-inch", "85-inch"],
    },
    features: ["AI ThinQ", "Built-in Voice Control", "Cinema HDR"],
  },
  product4: {
    name: "Headphones",
    brand: "Sony",
    price: 300,
    specifications: {
      type: "Over-Ear",
      wireless: true,
      noiseCancellation: true,
      colors: ["Black", "White", "Blue", "Red"],
    },
    features: ["Hi-Res Audio", "30-hour Battery Life", "Quick Charge"],
  },
  product5: {
    name: "Gaming Console",
    brand: "Microsoft",
    price: 500,
    specifications: {
      storage: "1TB",
      resolution: "4K",
      controller: "Wireless",
      graphicsCard: ["RTX 3060", "Radeon RX 6600", "AMD Graphics Core Next"],
    },
    features: ["Xbox Game Pass", "Backward Compatibility", "HDR Gaming"],
  },
};

Problems:

Easy:

  1. Problem: Access the brand of the Laptop.

    • Expected Output: Apple
  2. Problem: Retrieve the specifications of the Smartphone.

    • Expected Output: Object { screen: "6.5-inch AMOLED", camera: "Triple Camera Setup", battery: "4500mAh", colors: ["Black", "White", "Blue"] }
  3. Problem: Find the price of the Smart TV.

    • Expected Output: 2000
  4. Problem: Access the features of the Headphones.

    • Expected Output: ["Hi-Res Audio", "30-hour Battery Life", "Quick Charge"]
  5. Problem: Retrieve the controller type of the Gaming Console.

    • Expected Output: Wireless
  6. Problem: Change the price of the Laptop to 1700.

    • Expected Output: 1700
  7. Problem: Add a new color ("Silver") to the colors of the Smartphone.

    • Expected Output: ["Black", "White", "Blue", "Silver"]
  8. Problem: Remove the "Water Resistant" feature from the Smartphone.

    • Expected Output: ["Wireless Charging", "Face Recognition"]
  9. Problem: Add a new product ("Tablet") to the electronicProducts object.

    • Expected Output: Object { name: "Tablet", brand: "Unknown", price: 0, specifications: {}, features: [] }
  10. Problem: Retrieve the size options available for the Smart TV.

    • Expected Output: ["55-inch", "65-inch", "75-inch", "85-inch"]

Medium:

  1. Problem: Check if the Laptop has a "Touch ID" feature.

    • Expected Output: true
  2. Problem: Update the storage of the Gaming Console to "2TB".

    • Expected Output: "2TB"
  3. Problem: Remove the "Built-in Voice Control" feature from the Smart TV.

    • Expected Output: ["AI ThinQ", "Cinema HDR"]
  4. Problem: Add a new feature ("Bluetooth 5.0") to the Headphones.

    • Expected Output: ["Hi-Res Audio", "30-hour Battery Life", "Quick Charge", "Bluetooth 5.0"]
  5. Problem: Find all the available ports for the Laptop.

    • Expected Output: ["USB-C", "HDMI", "Thunderbolt"]
  6. Problem: Check if the Headphones come in a "Red" color.

    • Expected Output: false
  7. Problem: Retrieve the names of all products in electronicProducts.

    • Expected Output: ["product1", "product2", "product3", "product4", "product5", "product6"]
  8. Problem: Remove the "Radeon RX 6600" graphics card from the Gaming Console.

    • Expected Output: ["RTX 3060", "AMD Graphics Core Next"]
  9. Problem: Check if the Smartphone specifications include "AMOLED" screen.

    • Expected Output: true
  10. Problem: Add a new specification ("weight: 1.5kg") to the Laptop.

    • Expected Output: Object { processor: "Intel Core i7", memory: "16GB RAM", storage: "512GB SSD", ports: ["USB-C", "HDMI", "Thunderbolt"], weight: "1.5kg" }

Hard:

  1. Problem: Retrieve the names of products with a price less than $1000.

    • Expected Output: ["product2", "product4", "product5"]
  2. Problem: Change the brand of the Headphones to "Bose".

    • Expected Output: "Bose"
  3. Problem: Find the resolution of the Smart TV.

    • Expected Output: "4K Ultra HD"
  4. Problem: Remove the "HDR Gaming" feature from the Gaming Console.

    • Expected Output: ["Xbox Game Pass"]
  5. Problem: Check if the Gaming Console has a "Blu-ray" drive.

    • Expected Output: false
  6. Problem: Add a new specification ("frontCamera: 8MP") to the Smartphone.

    • Expected Output: Object { screen: "6.5-inch AMOLED", camera: "Triple Camera Setup", battery: "4500mAh", colors: ["Black", "White", "Blue"], frontCamera: "8MP" }
  7. Problem: Retrieve the colors available for the Headphones.

    • Expected Output: ["Black", "White", "Blue", "Red"]
  8. Problem: Check if the Laptop has a "Dedicated GPU" specification.

    • Expected Output: false
  9. Problem: Remove the "Backward Compatibility" feature from the Gaming Console.

    • Expected Output: ["Xbox Game Pass"]
  10. Problem: Calculate the total price of all electronic products.

    • Expected Output: 5300
  11. Problem: Add a new product ("Camera") with a price of $800 and no specifications or features.

    • Expected Output: Object { name: "Camera", brand: "Unknown", price: 800, specifications: {}, features: [] }
  12. Problem: Change the resolution of the Smart TV to "8K Ultra HD".

    • Expected Output: "8K Ultra HD"
  13. Problem: Check if the Laptop has a "Backlit Keyboard" feature.

    • Expected Output: true
  14. Problem: Remove the "Wireless Charging" feature from the Smartphone.

    • Expected Output: ["Water Resistant", "Face Recognition"]
  15. Problem: Retrieve the names of products with more than three features.

    • Expected Output: ["product1", "product2", "product3", "product5"]
  16. Problem: Add a new color ("Green") to the colors of the Headphones.

    • Expected Output: ["Black", "White", "Blue", "Red", "Green"]
  17. Problem: Check if the Smart TV has an "OLED" screen.

    • Expected Output: true
  18. Problem: Retrieve the type of headphones (Over-Ear, In-Ear, etc.).

    • Expected Output: "Over-Ear"
  19. Problem: Add a new feature ("Fingerprint Scanner") to the Smartphone.

    • Expected Output: ["Wireless Charging", "Water Resistant", "Face Recognition", "Fingerprint Scanner"]
  20. Problem: Find the size of the screen for the Smartphone.

    • Expected Output: "6.5-inch"
  21. Problem: Check if the Headphones have a "Microphone" feature.

    • Expected Output: false
  22. Problem: Remove the "AI ThinQ" feature from the Smart TV.

    • Expected Output: ["Built-in Voice Control", "Cinema HDR"]
  23. Problem: Retrieve the names of products with a price greater than $1000 and less than $2000.

    • Expected Output: ["product1", "product3"]
  24. Problem: Change the color of the Smartphone to "Gold".

    • Expected Output: ["Black", "White", "Blue", "Gold"]
  25. Problem: Check if the Laptop has a "USB-C" port.

    • Expected Output: true
  26. Problem: Remove the "30-hour Battery Life" feature from the Headphones.

    • Expected Output: ["Hi-Res Audio", "Quick Charge", "Bluetooth 5.0"]
  27. Problem: Retrieve the names of products with a "Wireless" controller.

    • Expected Output: ["product5"]
  28. Problem: Add a new specification ("refreshRate: 120Hz") to the Smart TV.

    • Expected Output: Object { screen: "55-inch OLED", resolution: "4K Ultra HD", operatingSystem: "WebOS", sizeOptions: ["55-inch", "65-inch", "75-inch", "85-inch"], refreshRate: "120Hz" }
  29. Problem: Check if the Headphones have a "Noise Cancellation" feature.

    • Expected Output: true
  30. Problem: Remove the "Xbox Game Pass" feature from the Gaming Console.

    • Expected Output: ["Backward Compatibility", "HDR Gaming"]

jsobject's People

Contributors

dmitryulasau avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.