You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
345 B
13 lines
345 B
function copy(from, to) {
|
|
for (var attr in to) {
|
|
if (from.hasOwnProperty(attr)) {
|
|
to[attr] = from[attr];
|
|
}
|
|
}
|
|
}
|
|
function findByNumberCopy(list, from) {
|
|
var to = Enumerable.from(list).where(function (o) { return o.number === from.number; }).firstOrDefault();
|
|
if (to) {
|
|
copy(from, to);
|
|
}
|
|
} |