0% found this document useful (0 votes)
6 views5 pages

Java Script

JavaScript is a versatile programming language primarily used for creating dynamic and interactive web content, capable of running on both client and server sides. It was developed to enhance user experience by allowing interactions without the need for page refreshes. JavaScript has evolved from a scripting language to a full-fledged programming language with frameworks and libraries, enabling its use in large-scale applications and server-side development.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views5 pages

Java Script

JavaScript is a versatile programming language primarily used for creating dynamic and interactive web content, capable of running on both client and server sides. It was developed to enhance user experience by allowing interactions without the need for page refreshes. JavaScript has evolved from a scripting language to a full-fledged programming language with frameworks and libraries, enabling its use in large-scale applications and server-side development.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

JavaScript

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)

Logical operators and bitwise operator


Falsey : undefined, null, nan , 0 , ‘’ (empty string), false
Truthy : anything except falsey
Short circuiting
If(false || false || true || false || false || false)
In above since there is || operator after true and if any one value is true || will always return
true so after true value machine will not check other condition and in case of && operator it
will only check for one false after that it won’t check

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

Is it necessary to use a semicolon in JavaScript?


Answer:
In JavaScript, using a semicolon (;) is technically optional in many cases due to a feature
called automatic semicolon insertion (ASI). However, it is generally recommended to use
semicolons explicitly to avoid unexpected behaviour. ASI may not always work as expected,
and omitting semicolons can sometimes lead to bugs, especially in more complex code. So,
while not always necessary, using semicolons is a good practice for clarity and reliability.

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.

What is scripting language?

Scripting language is a type of programming language which is used to automate process ,


often within other software environments. Scripting languages are usually interpreted, not
compiled. This means the code is read and executed line by line at runtime. Often used for
short task. Ex, JavaScript , Python , Bash
What is programming language?

A programming language is a formal language used to write instructions that a computer can
understand and execute.

 It can be used to build complex software systems, desktop applications, mobile


apps, games, and much more.
 Programming languages can be either compiled (like C++, Java) or interpreted (like
Python, Ruby).
 They allow you to work with memory, process data, handle logic, and control
hardware.
Example: Writing an entire operating system like Windows or macOS requires a full-fledged
programming language like C or C++.

3. JavaScript: Scripting or Programming Language?


JavaScript (JS) was originally created as a scripting language for adding interactivity to
web pages, such as dropdowns, sliders, and form validation.
 Over time, JavaScript has evolved into a full-fledged programming language with
frameworks, libraries, and tools.
 With the introduction of Node.js, JavaScript can now be used for server-side
development, making it suitable for large-scale applications.
 So, JavaScript is:
o A scripting language by origin and usage in browsers.
o A programming language by its current capabilities and use in full-stack
development.

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.

What are libraries?


A library is a collection of pre-written functions and code that you can use to solve specific
problems or add features to your application.
 You choose when and how to use a library in your code.
 Libraries don’t force a particular structure.
 Examples:
o jQuery – simplifies DOM manipulation in JavaScript.
o Lodash – provides utility functions for working with arrays, objects, and
strings.
o NumPy – used for numerical and matrix operations in Python.
Think of a library as a toolbox: you use the right tool when you need it.

What is a runtime environment?


A runtime environment is a platform that provides everything needed to run a program or
script.
 It includes the interpreter or compiler, memory management, input/output
handling, and libraries required to execute the code.
 The runtime environment is responsible for ensuring the code works correctly when
it's executed.
 Examples:
o A web browser (like Chrome) is the runtime environment for client-side
JavaScript.
o Node.js is the runtime environment for running JavaScript on servers.
o The Java Virtual Machine (JVM) is the runtime for Java code.
Without the runtime environment, your code won’t be able to execute.
What is Node.js?
Node.js is an open-source, cross-platform runtime environment that allows you to run
JavaScript outside the browser, typically on the server.
 Built on Google Chrome’s V8 JavaScript engine.
 Designed to build fast, scalable network applications, especially for web servers
and APIs.
 It uses a non-blocking, event-driven architecture, which makes it ideal for real-time
applications like chat apps or live streaming.
 With Node.js, you can:
o Build web servers.
o Connect to databases.
o Read/write files.
o Handle requests/responses on the backend.
Node.js turns JavaScript into a powerful backend programming tool, not just a browser
scripting language.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy