I have just started learning to React, I want to get key:value
pairs from array of object using a map loop, The result should look like this qty:1
, How can I achieve this result?
import React, { useState } from 'react';
import '../App.css'
const Baseexamplebox = () => {
return (
<div style={{marginTop:'30px'}}>
{variations.map((variant, i)=>(
<>
<div>{key}:{value}</div>
</>
))}
</div>
);
}
export default Baseexamplebox;
const variations = [
{
qty: 1,
cond: 'Original',
grade: '',
comment: '',
warranty: null,
price: null
}
]