JavaScript数组reduce()累加器为空

时间:2018-09-05 08:59:24

标签: javascript ecmascript-6

我正在拆分一个单词,并将每个单独的元素转换为莫尔斯电码。但是,返回值为空。不知道我在做什么错。

CREATE TABLE employee (
  id          NUMBER(10,0) PRIMARY KEY,
  name        VARCHAR2(100),
  designation VARCHAR2(10),
  idIfManager NUMBER(10,0) GENERATED ALWAYS AS (
                  CASE DESIGNATION WHEN 'MANAGER' THEN id END
                ) VIRTUAL
                CONSTRAINT employee__idIfManager__u UNIQUE
)
/

CREATE TABLE manager_details (
  id     NUMBER(10,0)
         PRIMARY KEY
         REFERENCES employee ( idIfManager ),
  name   VARCHAR2(100),
  salary NUMBER(12,2)
)
/

1 个答案:

答案 0 :(得分:2)

total + morseAlphabet[currentLetterIndex];

您正在寻找

total += morseAlphabet[currentLetterIndex];

https://www.w3schools.com/js/js_assignment.asp