{"size": 821, "ext": "js", "max_stars_repo_path": "JavaScript/WebWorkers/main.js", "max_stars_repo_name": "Ankitkumarji1323/engineering-blog-samples", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "JavaScript/WebWorkers/main.js", "max_issues_repo_name": "Ankitkumarji1323/engineering-blog-samples", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "JavaScript/WebWorkers/main.js", "max_forks_repo_name": "Ankitkumarji1323/engineering-blog-samples", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 17.1041666667, "max_line_length": 53, "alphanum_fraction": 0.5456760049}
const persons = [
  {
    name: "Joe",
    isMember: true,
  },
  {
    name: "Hriday",
    isMember: true,
  },
  {
    name: "Hridayesh",
    isMember: false,
  },
  {
    name: "Bob",
    isMember: true,
  },
  {
    name: "Daisy",
    isMember: true,
  },
];

// Our club container
const club = document.getElementById("club");
let worker;

function entry() {
  persons.forEach((person) => {
    const { isMember, name } = person;
    const listItem = document.createElement("li");
    listItem.textContent = name;
    if (!isMember) {
      worker = new Worker("worker.js");
      worker.postMessage(name);
      worker.addEventListener("message", (event) => {
        if (event.data) {
          club.appendChild(listitem);
        }
      });
    } else {
      club.appendChild(listitem);
    }
  });
}

entry();
