Use Destructuring Assignment to Assign Variables from Objects


#1

Tell us what’s happening:

Your code so far


function getLength(str) {
  "use strict";

  // 在这行以下修改代码
  const length = 0; // change this
  // 在这行以上修改代码

  return len; // 你必须在这行将<code>length</code>赋值给<code>len</code>

}

console.log(getLength('FreeCodeCamp'));

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.25 Safari/537.36 Core/1.70.3704.400 QQBrowser/10.4.3587.400.

Link to the challenge:
https://learn.freecodecamp.one/javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-objects


#2

函数并没有定义 len变量啊