Js adds elements to the array

how to extract fields from an array, and then add new fields to get the data as follows:

var data = [
{"id":"1","name":"","data":"25u6s8f545d3"},
{"id":"2","name":"","data":"cd58de9d3c5d"},
];

the format of the data I want to get is as follows:

var data = [
{"id":"1","name":"","data":"25u6s8f545d3","mac":"25:u6:s8:f5:45:d3"},
{"id":"2","name":"","data":"cd58de9d3c5d","mac":"cd:58:de:9d:3c:5d"},
];

my current method is as follows:

for (var i = 0; i < data.length; iPP) {
    var mac = data[i].data.toUpperCase();
        mac1 = mac.substring(0, 2);
        mac2 = mac.substring(2, 4);
        mac3 = mac.substring(4, 6);
        mac4 = mac.substring(6, 8);
        mac5 = mac.substring(8, 10);
        mac6 = mac.substring(10, 12);
        var mac = mac1 + ":" + mac2 + ":" + mac3 + ":" + mac4 + ":" + mac5 + ":" + mac6;
        data[i].mac = mac;
 };

is there a better way? I think my method is a little bad.

Feb.26,2021

var data = [
  { "id": "1", "name": "", "data": "25u6s8f545d3" },
  { "id": "2", "name": "", "data": "cd58de9d3c5d" },
];
data.forEach(item => {
  item.mac = item.data.replace(/\w{2}\B/g, '$&:')
})
console.log(data)

var data = [
  { "id": "1", "name": "", "data": "25u6s8f545d3" },
  { "id": "2", "name": "", "data": "cd58de9d3c5d" },
];
var newData= data.map(item =>Object.assign({},item,{mac:item.data.match(/\w{1,2}/gi).join(":")})
);

var data = [
  { "id": "1", "name": "", "data": "25u6s8f545d3" },
  { "id": "2", "name": "", "data": "cd58de9d3c5d" },
];
data.map(function(v,i){
    data[i].mac = v.data.replace(/(\w{2})\B/g,"$1:")
    //:
})
console.log(data)
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be91c6-3193b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be91c6-3193b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?