Cloning - Others
C#
var serialized = JsonConvert.SerializeObject(source);
return JsonConvert.DeserializeObject<T>(serialized);
JS
JSON.parse(JSON.stringify(original));
💎 Ruby
Marshal.load(Marshal.dump(@object))
var serialized = JsonConvert.SerializeObject(source);
return JsonConvert.DeserializeObject<T>(serialized);
JSON.parse(JSON.stringify(original));
Marshal.load(Marshal.dump(@object))