Trying to compare two set of data(object) but gett...
# suitescript
a
Trying to compare two set of data(object) but getting same result when they are actually different... is this the JavaScript Array/Object assignation biting me again?
s
I've not digested all the lines here, but with NFT I think this comparison would be about one line of code.
a
@stalbert Because in the background it have all the other code, I can make a function and call that function will be one line of code... exactly as NFT does...
s
indeed. Do you think it better use of your time to write code that does actual business logic rather than a bunch of 'background' code?
a
What you
gain
in time when coding using a bunch of
background
code you will lose it debugging/fixing when something does not work as expected because you are not familiar with the
background
code! Pick your poison...
k
@alien4u did you try
JSON.stringify(oldFields) === JSON.stringify(newFields)
?
s
If you're suggesting that using an existing, tested library is more work than writing one from scratch, debugging it, and writing unit tests for it then I have nothing more to add. 🙂
a
I'm suggesting that
using an existing, tested library
which is not the official NetSuite API and can fall into no working tomorrow if NetSuite decide to change something is not better than writing official NetSuite API code which you know and you can change and fix if needed! If you are telling me your library(which use NetSuite API in the background) would not break EVER... then I may use it...😉