Hello! I have a question regarding ES6 and FCC.
In the “Make a person” challenge, I tried implementing the ES6 syntax. The code would not work if I used “let” to declare the “Person” creator or the “Bob” instance.
Is it an issue with my code? Otherwise, is it an issue with browser compatibility (I use up to date Chrome) or FCC compatibility? If so, should I not use ES6 on FCC?
Below is my solution with the two “var”
Thanks!
//jshint esversion:6
var Person = function(firstAndLast) {
// Complete the method below and implement the others similarly
this.getFirstName = () => firstAndLast.split(" ")[0];
this.getLastName = () => firstAndLast.split(" ")[1];
this.getFullName = () => firstAndLast;
this.setFirstName = (first) => firstAndLast = first + " " + firstAndLast.split(" ")[1];
this.setLastName = (last) => firstAndLast = firstAndLast.split(" ")[0] + " " + last;
this.setFullName = (changed) => firstAndLast = changed;
};
var bob = new Person('Bob Ross');
bob.getFullName();