Javascript was invented by Brendan Eich when he was working for Netscape. It was originally called Livescript and got renamed to Javascript for marketing purposes as a result of Netscape’s partnership with Sun Microsystems.
Like Lua the language was largely inspired by Scala. Lua and Javascript has a lot of things in common - Lua could be described as a cleaner language since there wasn’t so much pressure to get it released. To this day Javascript has some odd flaws which are impossible to remove from the language given the massive install base.
Understanding Lua will help you understand Javascript better - on the whole since Lua is less popular the documentation that does exist is generally better quality than Javascript which bogged down with too many pages which describe “how to” but not why or fundamental concepts about the language.