Map State to Props_ Error "can not read property 'pop' of undefined"

Map State to Props_ Error "can not read property 'pop' of undefined"
0

#1

Tell us what’s happening:
What means the error “Can not read proeprty ‘pop’ of undefined” ?
I don’t know whats wrong there, please help me…

Your code so far


const state = [];

// change code below this line
let mapStateToProps = (state = [], messages) => {
  let Obj = {
    state: [],
    messages: state
  };
  return Obj.messages
};

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/front-end-libraries/react-and-redux/map-state-to-props