---
# System prepended metadata

title: "\U0001F3C5 JS 任務 Day15 - 從不同資料集，尋找規律性"
tags: [30 天軟體工程師體驗營｜2025]

---

---
tags: 30 天軟體工程師體驗營｜2025
---
> 建議觀看的影音章節：
> JS - 陣列教學
> JS - 物件教學
> JS - 陣列與物件整合運用

> 
# 🏅 JS 任務 Day15 - 從不同資料集，尋找規律性

### 題目一：判斷是否有值
* 判斷帶入參數是否有陣列中的值 
``` =JavaScript
const numAry = [1,3,4,6,8];

// input 輸入
checkNum(3)
checkNum(9)
checkNum(83)
checkNum(6)

// output 輸出 obj 的結果
true
false
false
true
```

### 題目二：刪除值
* 判斷陣列是否有值，有則刪除指定資料，並回傳 `deletAry` 變數
* 沒有則回傳 false
``` =JavaScript
b

// input 輸入
delNum(3)
delNum(9)
delNum(83)
delNum(6)

// output 輸出 obj 的結果
[1,4,6,8]
false
false
[1,4,8]
```

### 題目三：兩個陣列尋找相同數字
* 請找出 a 與 b 陣列裡面，若有相同數值，則篩選出來成為一個陣列
``` =JavaScript
const a = [1,3,4,6,8];
const b = [3,6,12];
// input 輸入
checkSame(a,b)


// output 輸出 obj 的結果
[3,6]
```



## 回報流程

1. 將答案貼在 Codepen 並複製 Codepen 連結貼至「回報區」回報
（也可以將答案直接貼至「回報區」）

![](https://i.imgur.com/vftL5i0.png)

<!--解答：
題目一：
const numAry = [1, 3, 4, 6, 8];

function checkNum(n) {
  return numAry.includes(n);
}

題目二：
let deletAry = [1, 3, 4, 6, 8];

function delNum(n) {
  const index = deletAry.indexOf(n);
  if (index !== -1) {
    deletAry.splice(index, 1); // 刪除該數值
    console.log(deletAry);
    return deletAry;
  } else {
    console.log(false);
    return false;
  }
}

題目三：
function checkSame(arr1, arr2) {
  return arr1.filter(item => arr2.includes(item));
}

const a = [1, 3, 4, 6, 8];
const b = [3, 6, 12];
-->

回報區
---

| 報數 | Discord 名字  |  Codepen／其他回饋                                                         |
|:----:|:-------------------:|:---------------------------------------------------------------------------------------------------------------------------------:|
|  1  | 4chan | [Codepen](https://codepen.io/ijuolaqc-the-looper/pen/EaaMmOw?editors=1011) |
|  2  | dean | [Codepen](https://codepen.io/ch933114/pen/NPPJgpR?editors=0011) |
|  3  | 登登登 | [Codepen](https://codepen.io/Duncanin/pen/EaaMvyB) |
|  4  | 7Lun | [Day15-Codepen](https://codepen.io/mfyvqhsn-the-bold/pen/Byybdpm?editors=0011) |
| 5|JHT|[Codepen](https://codepen.io/juanht/pen/wBBOezM?editors=0012)|
|6|Saika|[Codepen](https://codepen.io/saika4501/pen/dPPrVzd?editors=1111)|
|  7  | ying | [Codepen](https://codepen.io/Lara-Lin/pen/RNNdLvv?editors=1111) |
|  8  | mercury2508. | [Codepen](https://codepen.io/Mercury2508/pen/oggVwLJ) |
|  9  | RUDY | [Codepen](https://codepen.io/Rudy-crw/pen/VYYRryJ?editors=0010) |
|  10  | B | [Codepen](https://codepen.io/Babel777/pen/MYYxvVR) |
|  11  | WAWATA | [Codepen](https://codepen.io/wa-wa-GNOHC-WA-Wa/pen/RNNdgma)|
|  12  | 馬德 | [Codepen](https://codepen.io/maywang/pen/zxxbPoj?editors=0012)|
|  13  | WEIWEI | [Codepen](https://codepen.io/weiwei93/pen/WbbmMBQ) |
|  14  | William Hsieh | [Codepen](https://codepen.io/lsaimqxa-the-vuer/pen/bNNZKBZ?editors=0012) |
|  15  | ann.328 | [Codepen](https://codepen.io/yqmegupa-the-styleful/pen/raaRKBV) |
|16|蛋殼|[Codepen](https://codepen.io/weybrian/pen/vEEPrda)
|  17  | nora_zizi | [Codepen](https://codepen.io/Nora-Ch/pen/emmXjGV?editors=1011) |
|  18  | pastor | [Codepen](https://codepen.io/peter_hung/pen/WbbmZLv) |
|  19  | oyll | [Codepen](https://codepen.io/dizzydog-rgb/pen/myyoGLw?editors=0011) |
| 20 | SeanLuTW | [Codepen](https://codepen.io/sean85914/pen/QwwoZve) |
| 21 | Hawkeye Lin| [Codepen](https://codepen.io/long-long/pen/EaaMeBP) |
|  22  | Ariel | [Codepen](https://codepen.io/ariel0510/pen/KwwEEEy?editors=0011) |
|  23  | Chuang | [Codepen](https://codepen.io/uidoytjq-the-solid/pen/MYYxZKq?editors=0012) |
|  24  | 牛奶 | [Codepen](https://codepen.io/0omilko0/pen/VYYNKww?editors=0011) |
| 25 | ynag | [codepen](https://codepen.io/Yang-J/pen/QwwPbZW?editors=0012)|
| 26 | Leonard | [codepen](https://codepen.io/hyyfjqra-the-sans/pen/qEEwrae)|
|  27  |    Jessie_Yu    |         [Jessie_Yu 的 Codepen](https://codepen.io/bakyfkso-the-looper/pen/raabYjz)|
|  28  | wei_0982 | [Codepen](https://codepen.io/nico-lai/pen/MYYxMKm) |
|29|小趴|[Codepen](https://codepen.io/papa2415/pen/pomjbpN)|
|30|jinle0900|[Codepen](https://codepen.io/EvaLi0472/pen/ByyEexG?editors=1011)|
|31|BL|[Codepen](https://codepen.io/bonnieli1414/pen/azzrJyM?editors=0012)|
|32|力文|[Codepen](https://codepen.io/liwenchiou/pen/MYYdXdY?editors=0011)|
|33| kelsonhouse | [Codepen](https://codepen.io/Kelson-House/pen/zxxVBoN?editors=0011)|
|34| Hugh | [Codepen](https://codepen.io/Hugh-Chen/pen/yyydbaQ)|
|35| vima | [Codepen](https://codepen.io/chin7004/pen/OPVNbbv?editors=0011) |
|36| ja4071 | [Codepen](https://codepen.io/SHAO-L/pen/GgJqQyv?editors=1112)|
|37| ninii | [Codepen](https://codepen.io/niiniiii/pen/OPVpgmg?editors=1111)|
|38| 叮咚 | [Codepen](https://codepen.io/pinchieh-lin/pen/QwbBWgg?editors=1111) |
|  39  | haohaoliao | [Codepen](https://codepen.io/yuyuyuhaohao/pen/WbrjgyM?editors=0012) |
<!--【快速複製】    
|  num  | user | [Codepen]() |
--> 