How to recurse the array into a: {b: {c: {d: "test"}

var test = "a.b.c.d"

how to recursively to

a:{
   b:{
     c:{
        d:"test"
       }
     }
   } 
Feb.22,2022

Loop algorithm:

 {
      var test = "a.b.c.d";
      let arr = test.split('.');

      let newtest = 'test';
      for(let i = arr.length - 1; i >= 0; i--){
         let obj = {};
         obj[arr[i]] = newtest;
         newtest = obj;
      }
      console.log(newtest);
    }
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-1e4d756-44f3a.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-1e4d756-44f3a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?