100 likes | 117 Views
What is Java Script. Wikipedia JavaScript is a high level dynamic, untyped and interpreted programming language standardized in the ECMA Script language specification, that alongside HTML and CSS is one of the three core technologies of world wide web content. History of JavaScript.
E N D
What is Java Script Wikipedia JavaScript is a high level dynamic, untyped and interpreted programming language standardized in the ECMA Script language specification, that alongside HTML and CSS is one of the three core technologies of world wide web content
History of JavaScript • JavaScript was created by Brendan Eich in 1995 during his time at Netscape Communications. It was inspired by Java, Scheme and Self • It was originally called Mocha, then renamed to LiveScripts and finally to JavaScripts when Netscape and Sun Microsystems did a licensing agreement that included the language. • The idea at the time was to make a scripting language complementary to Java and cash in on Java's popularity . • The goal was that higher-end programmers used Java and JavaScript was created to fill the need for a “glue language” used by informal programmers and designers.
JavaScript and Java • Even though the names of these languages share the term Java, they're not really closely related. They share C-style syntax but otherwise have very different purposes and very different principles • Both Java and JavaScript are broadly portable, Java through its JVMs and JavaScript through broad implementation of the language in various browsers and other runtimes • Java is compiled to bytecode, whereas JavaScript is not compiled at all, it's interpreted at runtime • JavaScript is the dominant programming language in web browsers. To run Java code in a web browser, you would need an additional plugin. In Java, you can call native functions through the JNI interface. But JavaScript, at least when executed within a web browser, runs in a security sandbox that doesn't allow it access to local resources
Tools needed • Code Editor • Browser with developer tools • Helper tools for debugging etc
Browser Console: A JS Playground • The browser is the natural environment for JavaScript and modern browsers ship with development tools built right in to work with JavaScript for logging,testing, debugging, and more. • Knowing how to use these development tools will make working with JavaScript much easier and more interesting. • Open by clicking Ctrl+Shift+I on the webpage or right click and select inspect
Inline JS /JS as an external File • Inline Js is suitable for smaller script files • JS referenced as an external file is a better approach as it allows for modularity and separation of interactive logic from Content
How to write good JavaScript • JS is Case Sensitive • Use CamelCase Naming Convention which means we can concatenate words, and separate them by capitalizing the first letter of each word • JS doesnot care about white spaces but they make the code human readable • End each statement with a semicolon • Use Comments
What can JavaScript Do • It can change HTML content, atributes • It can change CSS style • It can hide and show HTML elements • It can access the Dom and manipulate its objects • It can work with forms • It can manipulate HTML objects • It can react to events • It can access and manipulate Browser objects
Current Landscape • Confirms to ever evolving ECMAScript Standard • ECMAScript2015: The current specification Also known as ES6 • Browser use ECMAScript to interpret JS ECMAScript • Abstractions like Jquery, Kube etc which make it easy to use JS in websites • Frameworks: Angular, React, Vue.Used to make single page websites. Very popular • Node: Server side scripting
Learning Sources • MDN's JavaScript reference • W3Schools • Courses on Udemy, Udacity, CourseEra • Khan Academy • Learning platform by LinkedIn