I'm playing around with PEG.js
start = keyword
keyword = a:[a-z]? {return a.join("");}
Why am I getting here the error:
a.join is not a function
when I enter a valid string like abc
?
The NOT Function[1] is an Excel Logical function. The function helps check if one value is not equal to another. If we give TRUE, it will return FALSE and when given FALSE, it will return TRUE. So, basically, it will always return a reverse logical value.
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value is not actually a function.
join() The join() method creates and returns a new string by concatenating all of the elements in an array (or an array-like object), separated by commas or a specified separator string. If the array has only one item, then that item will be returned without using the separator.
The split() method splits a string into an array of substrings. The split() method returns the new array. The split() method does not change the original string. If (" ") is used as separator, the string is split between words.
join()
is an array-function, you cannot use it on a string:
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/join
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With