I have an array. If the name value is empty, I need to change it to the end of the array, how can I do that in Javascript?
ex:
const data : [
{
id:0,
name:"gorkem"
}
{
id:1,
name:""
}
{
id:2,
name:"ahmet"
}
];
Replace
const data : [
{
id:0,
name:"gorkem"
}
{
id:2,
name:"ahmet"
}
{
id:1,
name:""
}
];