{"size": 634, "ext": "js", "max_stars_repo_path": "src/index_immutablitytesting.js", "max_stars_repo_name": "morpheous27/react-redux", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/index_immutablitytesting.js", "max_issues_repo_name": "morpheous27/react-redux", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/index_immutablitytesting.js", "max_forks_repo_name": "morpheous27/react-redux", "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": 22.6428571429, "max_line_length": 53, "alphanum_fraction": 0.6482649842}
//mutable version
/* function updateCity(employee,city) {
  
   employee.city = city;
   return employee; 
} */
//immutable version
function updateCity(employee, city) {
  //  return Object.assign({}, employee, { city });
  return { ...employee, city };
}
let employee = {
  id: 1,
  name: "Subramanian",
  city: "Chennai"
};
Object.freeze(employee);
let updatedEmployee = updateCity(employee, "Delhi");
console.log(employee);
console.log(updatedEmployee);

let list = [1, 2, 3];
//Test whether list is mutable or not
Object.freeze(list);
//list.push(4);
console.log(list.concat([4]));
//console.log(list);
