I just encountered a strange situation. I want to post a code snippet but after submitting the result is different from what I have in the preview. I also tested this in the browser console which shows me the same result as the preview. So after submitting the output is wrong.
This is the code
const tabbedString = `Prefix Name Last Name Email Phone Age Role
Jim Loco [email protected] 32 Admin
Mrs. Sara Foo [email protected] 124389 44 Admin
Mr. John Deer [email protected] 37 Developer`
const parsedString = tabbedString.split('\n').map((line) => line.split('\t'))
console.log(parsedString)
Expected output
[
[
"Prefix",
"Name",
"Last Name",
"Email",
"Phone",
"Age",
"Role"
],
[
"",
"Jim",
"Loco",
"[email protected]",
"",
"32",
"Admin"
],
[
"Mrs.",
"Sara",
"Foo",
"[email protected]",
"124389",
"44",
"Admin"
],
[
"Mr.",
"John",
"Deer",
"[email protected]",
"",
"37",
"Developer"
]
]
When I create this as snippet, as already mentioned, in the preview i get this expected result. However, after submitting its different.
const tabbedString = `Prefix Name Last Name Email Phone Age Role
Jim Loco [email protected] 32 Admin
Mrs. Sara Foo [email protected] 124389 44 Admin
Mr. John Deer [email protected] 37 Developer`
const parsedString = tabbedString.split('\n').map((line) => line.split('\t'))
console.log(parsedString)