+ 3
ODLNT You're right about that. But too bad I'm not clearly understanding OP's actual intention for output ... If 1st textarea contains "hi", and 2nd textarea contains "h" then the expected output will be "hi". This part is rather confusing as to how and why : ) * OP deleted original code. Relevance is gone, better leave this now.
30th Aug 2022, 7:43 PM
Ipang
+ 2
<result> is an object, convert it to string first before splitting ... .innerHTML = result.toString().split( " " );
30th Aug 2022, 3:57 AM
Ipang
+ 2
Ipang does the String method match return an object or an array?
30th Aug 2022, 1:40 PM
ODLNT
ODLNT - avatar
+ 2
ODLNT An array, as per MDN https://developer.mozilla.org/id/docs/Web/JavaScript/Reference/Global_Objects/String/match But logging `typeof result` in console shows 'object', as usual ...
30th Aug 2022, 2:47 PM
Ipang
+ 2
Ipang As you already know all arrays are objects... I would suggest using the Array method join since match returns an array.
30th Aug 2022, 5:08 PM
ODLNT
ODLNT - avatar