---
# System prepended metadata

title: 7kyu Love vs friendship 字母數字對照表

---

#  7kyu Love vs friendship 字母數字對照表


### 基本想法需要一個對照表直接查
![](https://i.imgur.com/7WqiIAd.png)

```javascript=
// 所以想到用ASCII a 從97開始
function wordsToMarks(string) {
  //your code here
  let charArr = string.split("");
  let total = 0;
  charArr.forEach((char) => {
    total += char.charCodeAt() - 96;
  });
  return total;
}

```