Javascript Flashcards
Outline the differences between client-side scripting and server-side scripting.
Client Side:
-HTML, CSS, Javascript used
-Source code visible to User
-No security for data
-Main function to provide the requested output.
-Depends on browser and verison
-Runs on user’s computer
Server-Side Scripting
-PHP, Python, Javascript etc.
-Source code invisible
-More security
-Main function to provide access to database as per request.
-Does not depend on the browser
-Runs on the web server
Who designed Javascript? Working for who? When? How long did it take?
Brendan Eich
Netscape
1995
10 days
When did Javascript become an ECMA standard?
1997
What does ECMA stand for?
European Computer Manufacturers Association.
Outline the key differences between JAVA and javascript.
JAVA:
compiled
back-end
Strong security
C++ syntax
Requires JAVA development kit
For various apps
Javascript:
Interpreted
Front-end
Weak security
C syntax
Written in any text editor
Mainly for web apps
What are the three approaches for adding Javascript to a HTML file?
External .js file
Internal between
tag
Inline javascript handles directly within HTML
What is the pros and cons of internal javascript?
Pros: Fast to implement
Easy to Read Code
Cons:
Makes it hard to reuse code.
Slows Performance.
What are the pros and cons of inline javascript?
Pros: Quick to implement
Perfect for a small app
Cons: The code is not reusable.
Slows performance
Code readability concerns
What function is used to select HTML elements by id?
getElementById((“id”)
What function adds an element to the end of an array and what function adds an element to the start of the array?
push(element to be added)
unshift(element to be added)
What function removes (a) the last element of an array and (b) the first element of an array and returns that element?
pop()
shift()
When are backticks used in javascript?
When you want to include a variable value in the print statement of a string.
Equality and non-equality symbols for javascript.
Equality: ===
Non-equality: !==
Syntax for an arrow function.
let function_name = (argument1, argument2,..) => expression
What is an event in javascript?
Events are things that happen in the system you are programming, which the system tells you about so your code can react to them.