React and redux - Map state to Props

Tell us what’s happening:
My code is working. test passed :100:
But i want to know is my method is correct :roll_eyes:. I am not using arrow function.

Your code so far
const state = ;

// change code below this line
function mapStateToProps(state) {
return {
messages: state
}
}


const state = [];

// change code below this line
function mapStateToProps(state) {
return {
  messages: state
}
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36.

Challenge: Map State to Props

Link to the challenge: