Skip to content

Instantly share code, notes, and snippets.

@baralogi
Last active February 17, 2021 04:26
Show Gist options
  • Save baralogi/566b2ff6d632cdebd986755741a126f1 to your computer and use it in GitHub Desktop.
Save baralogi/566b2ff6d632cdebd986755741a126f1 to your computer and use it in GitHub Desktop.
let str = "ENROLL_FP PIN=4832 FID=0 RETRY=3 OVERWRITE=1";
let res = str.replace("ENROLL_FP ", "");
let splitX = res.split("\t")
let values = splitX
let newObject = {}
let data = values.forEach((item, index) => {
let array = item.split("=")
let keyX= array[0].toLowerCase();
let valueX= array[1];
newObject[keyX] = valueX;
})
console.log(newObject)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment