My issue is with SCORES, when I console.log the entire object the scores part is somehow showing an extra set of brackets.
$(".submit").on("click", function() {
var newRoommate = {
"firstname": $('#first_name').val().trim(),
"lastname": $('#last_name').val().trim(),
"photo": $('#user_photo').val().trim(),
scores: [
$('#question_1').val(),
$('#question_2').val(),
$('#question_3').val(),
$('#question_4').val(),
$('#question_5').val(),
$('#question_6').val(),
$('#question_7').val(),
$('#question_8').val(),
$('#question_9').val(),
$('#question_10').val()
],
scoresInput
};
console.log(newRoommate); // .... scores[]: Array(10)
Why is it showing scores[]:?
Ideally, I want it to result in something like this when console.log.
{
firstname:"Ricky",
lastname:"Bobby",
photo:"http://www.topcelebsjackets.com/wp-content/uploads/2017/03/Talladega-Nights-Wonder-Bread-Ricky-Bobby-Jacket-6-570x708.jpg",
scores:[
5,
1,
4,
4,
5,
1,
2,
5,
4,
1
]
}