How to fix the Js.Array.t<array<string>> (defined as array<array<string>>) error

type t = {
id:int ,
name: string,
marks: array<array>
}

let newF = () => {
let cxf = {id:0, name: “”, marks:[[]]}
let newcfx = {id:1, name: “”, marks:[[]]}
cxf.marks->Array.getUnsafe(0)->Js.Array.push(newcfx)
}
getting the Js.Array.t<array> (defined as array<array>) error while trying to push it to Js.Array.push(newcfx)

What are you trying to do in that code snippet?

The error is saying that you’re trying to use Js.Array.push on an object of type t (newcfx), but Js.Array.push needs an array.

able to fix it… Thanks for your input