I am working with an array in JavaScript. When the name value is empty, I want to move it to the end of the array. How can I achieve this?
Example:
const data : [
{
id:0,
name:"gorkem"
}
{
id:1,
name:""
}
{
id:2,
name:"ahmet"
}
];
After Replacement:
const data : [
{
id:0,
name:"gorkem"
}
{
id:2,
name:"ahmet"
}
{
id:1,
name:""
}
];