JSFiddle - React, Tailwind, and code Playground

by manoj_antony32

JavaScript

var displayKey = ['branch', 'host', 'email', 'name'];
var arr = ["#Generated by Git-Commit-Id-Plugin\r", "#Wed Oct 09 10:51:27 IST 2019\r", "git.branch=develop\r", "git.build.host=CHEW00500450\r", "git.build.time=2019-10-09T10\\:51\\:27+0530\r", "[email protected]\r", "git.build.user.name=karthee G\r", "git.build.version=8.0.1-SNAPSHOT\r", "git.closest.tag.commit.count=\r", "git.closest.tag.name=\r", "git.commit.id=8eda76d7ae36ec20fd11bad7c0724fad61829d08\r", "git.commit.id.abbrev=8eda76d\r", "git.commit.id.describe=8eda76d\r", "git.commit.id.describe-short=8eda76d\r", "git.commit.message.full=Merge pull request \\#871 in DIGITALWINGS/m-wings-controller from feature/DW-8258 to develop\\n\\n* commit '44deff1028327cbfac02f59fa5e4b4c7eed6d341'\\:\\n  DW-8258\\: Fixed compilation error\\n  NOJIRA\\: Updated bom to 8.0.34\r", "git.commit.message.short=Merge pull request \\#871 in DIGITALWINGS/m-wings-controller from feature/DW-8258 to develop\r", "git.commit.time=2019-10-08T18\\:18\\:37+0530\r", "[email protected]\r", "git.commit.user.name=Raed KITAR\r", "git.dirty=false\r", "git.remote.origin.url=ssh\\://[email protected]\\:7999/digitalwings/m-wings-controller.git\r", "git.tags=\r", "git.total.commit.count=3542\r", ""];

// console.log(arr)

var a1 = [1, 2, 3, 4, 5]
var a2 = [2, 4]

var resultSet = [];
var result = displayKey.filter(function(e) {
//console.log(e)
let key = e;
arr.filter(function(e) {
 if(e.indexOf(key) !== -1) {
   resultSet[key]= e.split('=')[1]; 
   //resultSet.push(e.split('=')[1])
 }
});
console.log(resultSet)
//console.log(arr.indexOf(e))
 //return (a2.indexOf(e) !== -1).length === a2.length
});
//console.log(result)