how to shallow clone javascript class

class myClass {
constructor() {
this.str = "String"; //Defining a string
this.number = 3; //Defining a number

var classReference = new myClass(); //Making new instance of class
var myObjectToCopy;

function copyClass() {
myObjectToCopy = JSON.parse(JSON.stringify(classReference)); //Converting class to a string then turning that string into an object

copyClass(); //Calling function to copy the class

//myObjectToCopy is now a copy of classReference

how to remove an class in javascript

//remove a css class from an element


function removeClass() {
  var element = document.getElementById("myDIV");