what is the main use of java script
As a multi-paradigm language, JavaScript supports event-driven, functional, and imperative (including object-oriented and prototype-based) programming styles. It has an API for working with text, arrays, dates, regular expressions, and basic manipulation of the DOM, but does not include any I / O, such as networking, storage, or graphics facilities, relying for these upon the host environment in which it is embedded.