How to Compare Two JavaScript Objects With Stringify

preview_player
Показать описание
How to compare 2 JavaScript objects by their content rather than their reference using JSON.stringify.

📣 Follow Coding in Flow on social media:
Рекомендации по теме
Комментарии
Автор

You should make a video about how to copy a variable/array/object etc... without being REFERENCE to each other. Just to clear the concept of REFERENCE.

gabormiklay
Автор

How about this on the concept of REFERENCE vs. COPY:

let og_array = [0, 1, 2, 3, 4, 5]
let ref_array = og_array
ref_array[0] =
console.log(og_array)
let copy_array = []
og_array.forEach((i) => {
copy_array.push(i)
})
copy_array[0] = 0
console.log(copy_array)
console.log(og_array)

gabormiklay
Автор

Yeah, a lot of people doesn't get the concept what REFERENCE to a variable/object means.

gabormiklay