Javascript error on .split.filter
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 05:50 AM - edited 04-23-2024 05:50 AM
I am trying to run this snippet of code in a background script to prove it works on my data but it errors out with
Javascript compiler exception: syntax error (null.null.script; line 😎
This is the line in question:
const entries = logString.split(pattern).filter(logStr => logStr.trim() !== '');
This snippet was built using real documentation so I figure it should work (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter). Any idea what I might need to do to make this work in SN?
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 11:28 AM
Hi @e_wilber ,
Take a look at this community post that talks about using Array Filtering (and other Array methods):