It would be very interesting to have a parser as have some text adventures created with systems like Inform or Tads.
I do not know if it's possible with javascript.
JavaScript is Turing complete and, more to the point, has good string processing capabilities. So, yes, it is indeed possible.
I can't point to any examples off-hand (the last text parser games I played were MUDs a couple of decades ago), but searching for something like "javascript text adventure game parser" in your favorite search engine would probably yield some results.
Comments
I can't point to any examples off-hand (the last text parser games I played were MUDs a couple of decades ago), but searching for something like "javascript text adventure game parser" in your favorite search engine would probably yield some results.