Java Script
Java Script
What is JS?
JavaScript is a scripting or programming language that allows you to implement complex
features on web pages. Primarily used for creating dynamic and interactive content on
websites. It enables you to create dynamically updating content, control multimedia, animate
images. JavaScript can run on the client side (in the browser) or server side (using
environments like Node.js).
What was the need for JS?
JavaScript was created to enhance the user experience by making web pages more interactive
and dynamic. Before JavaScript, web pages were largely static, and every user interaction
required sending a request to the server. JavaScript allows interactions like clicking buttons,
submitting forms, or loading new content without refreshing the entire page.
Advantages and Disadvantages of JS?
https://www.codehelp.in/tutorial/javascript/java-script-a-beginner-s-guide-to-programming-
magic-1
JS : a general-purpose programming language or scripting language?
JS : client side or server-side language?
Variables and datatypes in JavaScript?
Operators and conditionals?
Binary Operators : a + b here a and b are operands and + is operator , two operands so binary
operators
Unary Operators : a ++ , --a here one operand so unary operator ++ is operator
Arithmetic Operator : + , - , * , / , ** (power operator) , %
Comparison Operator : Strict equality and loose equality
Operators : < , > , >= , <= , == , === , != , !== returns Boolean value
Ternary operator : condition ? value if condition is true : value if condition is false;
=== , !== strict equality : check both datatypes and values
== , != loose equality : check only values
String can be formed by using ‘’ (single inverted commas) as well as “” (double inverted
commas)
Bitwise operator
If most significant bit is 1 that is sign bit then for finding decimal of it find 2’s compliment
2’s compliment = 1’s compliment + 1
For negative numbers, left shift can alter the sign, especially in fixed-bit systems.
Arithmetic right shift preserves the sign bit, making it useful for signed integers.
A programming language is a formal language used to write instructions that a computer can
understand and execute.
What is a framework?
A framework is a collection of pre-written code and tools that helps developers build
applications faster and more efficiently.
It provides a structure or skeleton for your application.
Frameworks come with built-in features and functions, so you don’t have to write
everything from scratch.
They often follow specific design patterns and rules (like MVC – Model-View-
Controller).
Examples:
o React.js – for building user interfaces.
o Angular – a full front-end framework.
o Express.js – for backend applications using Node.js.
o Django – for building web apps in Python.
Difference from a library: A framework calls your code, while with a library you call the
library.