GS vs JSUtil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2022 08:32 AM
Hi all, I am trying to find the difference between using JSUtil.notNil() vs !gs.nil(). From my education they both do the same thing but Im wondering which one is better performance wise gs or JSUTIL and if there is a current standard on which one i should be using consistently over the other. Let me know. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2022 04:59 PM
Hi according to the doc's JSUtil is not available for scoped apps
JSUtil - Global (servicenow.com)
but gs.nil() is
GlideSystem | ServiceNow Developers
!gs.nil() must also be about 50% more efficient typing wise.
Based on the scope limitation I would probably stick to !gs.nil(),
as less chance of an off day and chasing your tail if you accidently(habitually) use JSUtils in a scoped app.