Tell us what’s happening:
Your code so far
function getLength(str) {
"use strict";
// change code below this line
const length = {len:str.length}; // change this
const {len} = length;
// change code above this line
return len; // you must assign length to len in line
}
console.log(getLength('FreeCodeCamp'));
Error: // running test
destructuring with reassignment was used
// tests completed
How is it fix?
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-assign-variables-from-objects