---
# System prepended metadata

title: JavaScript questions
tags: [career, ' interview', ' javascript']

---

---
title: "JavaScript questions"
description: "......."
excerpt: "......"
tags: career, javascript, interview
date: "2023-01-03"
coverImage: 'https://japandiary.tw/wp-content/uploads/%E5%8B%95%E7%95%AB-Lycoris-Recoil-%E8%8E%89%E5%8F%AF%E9%BA%97%E7%B5%B2-2.jpg'
author:
  name: Chen Han
  picture: 'https://i.pinimg.com/564x/07/a5/a9/07a5a9030b2b01e6b428226305c49548.jpg'
ogImage:
  url: 'https://cdn.pixabay.com/photo/2016/09/01/19/53/pocket-watch-1637396__480.jpg'

---

## Interview test (面試題目)

1. 想要請您解釋下列的程式碼代表什麼意思

   ````js
   const compare = a => b => a <= b 
   ````

2. 接續上題，想要請您用個簡單的陣列，搭配map來使用它

3. 想要請您利用下列資料做出一個訂單明細頁（靜態頁面）

   ````javascript
   {
     "id": 17383,
     "customer_id": 0,
     "date_created": "Wed, 11 Jan 2023 06:06:51 +0000",
     "date_modified": "Wed, 11 Jan 2023 06:06:51 +0000",
     "date_shipped": "",
     "status_id": 1,
     "status": "Pending",
     "subtotal_ex_tax": "120.0000",
     "subtotal_inc_tax": "120.0000",
     "subtotal_tax": "0.0000",
     "base_shipping_cost": "0.0000",
     "shipping_cost_ex_tax": "0.0000",
     "shipping_cost_inc_tax": "0.0000",
     "shipping_cost_tax": "0.0000",
     "shipping_cost_tax_class_id": 0,
     "base_handling_cost": "0.0000",
     "handling_cost_ex_tax": "0.0000",
     "handling_cost_inc_tax": "0.0000",
     "handling_cost_tax": "0.0000",
     "handling_cost_tax_class_id": 0,
     "base_wrapping_cost": "0.0000",
     "wrapping_cost_ex_tax": "0.0000",
     "wrapping_cost_inc_tax": "0.0000",
     "wrapping_cost_tax": "0.0000",
     "wrapping_cost_tax_class_id": 0,
     "total_ex_tax": "120.0000",
     "total_inc_tax": "128.4000",
     "total_tax": "8.4000",
     "items_total": 1,
     "items_shipped": 0,
     "payment_method": "PayPal",
     "payment_provider_id": "1UT71582DU8167934",
     "payment_status": "",
     "refunded_amount": "0.0000",
     "order_is_digital": false,
     "store_credit_amount": "0.0000",
     "gift_certificate_amount": "0.0000",
     "ip_address": "",
     "ip_address_v6": "",
     "geoip_country": "",
     "geoip_country_iso2": "",
     "currency_id": 1,
     "currency_code": "USD",
     "currency_exchange_rate": "1.0000000000",
     "default_currency_id": 1,
     "default_currency_code": "USD",
     "staff_notes": null,
     "customer_message": null,
     "discount_amount": "0.0000",
     "coupon_discount": "0.0000",
     "shipping_address_count": 1,
     "is_deleted": false,
     "ebay_order_id": "0",
     "cart_id": null,
     "billing_address": {
       "first_name": "Abdullah",
       "last_name": "Almaslamani",
       "company": "",
       "street_1": "4283 Express Ln",
       "street_2": "",
       "city": "Sarasota",
       "state": "Florida",
       "zip": "34238",
       "country": "United States",
       "country_iso2": "US",
       "phone": "",
       "email": "deadlyvisions@hotmail.com",
       "form_fields": []
     },
     "is_email_opt_in": false,
     "credit_card_type": null,
     "order_source": "external",
     "channel_id": 1,
     "external_source": null,
     "products": {
       "url": "https://api.bigcommerce.com/stores/k28u1tc9ki/v2/orders/17383/products",
       "resource": "/orders/17383/products"
     },
     "shipping_addresses": {
       "url": "https://api.bigcommerce.com/stores/k28u1tc9ki/v2/orders/17383/shipping_addresses",
       "resource": "/orders/17383/shipping_addresses"
     },
     "coupons": {
       "url": "https://api.bigcommerce.com/stores/k28u1tc9ki/v2/orders/17383/coupons",
       "resource": "/orders/17383/coupons"
     },
     "external_id": null,
     "external_merchant_id": null,
     "tax_provider_id": "",
     "customer_locale": "",
     "external_order_id": "",
     "store_default_currency_code": "USD",
     "store_default_to_transactional_exchange_rate": "1.0000000000",
     "custom_status": "Pending"
   }
   ````

   4. 試試把原本輪播的地方改成 parallel scroll （提示：使用 gsap，可以參考[這裡](https://greensock.com/forums/topic/33311-using-gsap-scrolltrigger-for-horizontal-scroll/)）

      https://jioujiou9308.github.io/CSS_Project/furniture_store/index.html#slide-4

   5. 想要請您使用您使用過的firebase，實作將 axios 自動利用換發 access_token 的機制。可以參考 [這裡](https://dotblogs.com.tw/wasichris/2020/10/25/223728)

      https://github.com/jioujiou9308/react_firebase_website

   6. 使用 react.js 實作購物車

      - 樣式使用 tailwind - 看能用多少
      - 狀態管理工具請使用 recoil, contextProvider, redux ...
      - 使用 api 或者使用 setTimeout 來實作可以非同步的概念

   7. 使用 react.js 實作簡單的 blog post

      - 新增、更新表單使用 react-hook-form + yup

      - 送出表單的按鈕再送出時希望可以看到 loading 字樣或轉圈

        （ 可以使用useState實作， react-query 更好 ）

   