I have this code:

```
let cart = [];
let item1 = {
        name: "CD - Animal",
        price: "12",
        qntd: "0"
    };

let item2 = {
    name: "CD - Cannibal",
    price: "10",
    qntd: "0"
};

$("button").click(function() {
    event.preventDefault();
    var li = $(this).parent();
    var quantity = $(li).find('input[type=number]').val();
    eval($(this).val()).qntd = quantity;
    cart.push(eval($(this).val()));
    console.log(item1.qntd);
    localStorage.setItem(cart, JSON.stringify(cart));
    console.log(cart[0].name);
    console.log(JSON.parse((localStorage.getItem(cart[0].name))));
});

```

But `cart[0].name` does not return the object's name, instead, returns null.

`cart[0]` returns the object correctly, `0:{name: "CD - Animal", price: "12", qntd: "3"}`, but when I try to get `cart[0].name`, it returns null instead of "CD - Animal".

HTML:

```
<div class="card-content animal">
    <form style = "display: flex; justify-content: space-between; flex-wrap: wrap;">
        <input type = "number" class = "qntd" placeholder="Quantidade" style = "width: 100%; margin-top: -20px;" maxlength="10">
        <button class="btn waves-effect waves-light" type="submit" name="action" value = "item1">Add
            <i class="material-icons right">attach_money</i>
        </button>
    </form>
</div>

```