JavaScript is a versatile programming language primarily used to create dynamic and interactive features on websites. JavaScript is a scripting language that allows you to implement complex features on web pages. Browsers have Interpreters. It will converts JAVASCRIPT code to machine code. Browsers have its own interpreters like
Chrome – V8-engine
Edge – Chakra
JavaScript- Identifiers :
var message; –> Variable (Identifier) message = ‘Javascript’;
func sayHello() { console.log(‘Hello’) }
//sayHello Is the identifier for this function.
//variables , objects,functions,arrays ,classes names are identifiers in js.
SCOPE : In JavaScript, scope refers to the context in which variables and functions are accessible. It determines the visibility and lifetime of these variables and functions within your code. There are three main types of scope in JavaScript.
Global Scope:.
Variables declared outside any function or block have global scope.
These variables are accessible from anywhere in the code
example :
let globalVar = "I'm global";
function test() {
console.log(globalVar); // Accessible here
}
test();
console.log(globalVar); // Accessible here too
Function Scope
Variables declared within a function are local to that function.
They cannot be accessed from outside the function.
example :
function test() {
let localVar = "I'm local";
console.log(localVar); // Accessible here
}
test();
console.log(localVar); // Error: localVar is not defined
Block Scope:
Introduced with ES6, variables declared with let or const within a block (e.g., inside {}) are only accessible within that block
example :
{
let blockVar = "I'm block-scoped";
console.log(blockVar); // Accessible here
}
console.log(blockVar); // Error: blockVar is not defined
Keywords | Reserved Words
Keywords are reserved words in JavaScript that cannot use to indicate variable labels or function names.
Variables
variables ==> stored values ==> it will stored to ram / It will create separate memory.so we need memory address for access the values.
Stores Anything : JavaScript will store any value in the variable.
Declaring Variable :
* Var
* let
* const
we can declare variable using above keywords:
Initialize Variable :
Using assignment operator to assign the value to the variables.
var text = "hello";
JavaScript is a versatile programming language primarily used to create dynamic and interactive features on websites. JavaScript is a scripting language that allows you to implement complex features on web pages. Browsers have Interpreters. It will converts JAVASCRIPT code to machine code. Browsers have its own interpreters like
Chrome – V8-engine
Edge – Chakra
JavaScript- Identifiers :
var message; –> Variable (Identifier) message = ‘Javascript’;
func sayHello() { console.log(‘Hello’) }
//sayHello Is the identifier for this function.
//variables , objects,functions,arrays ,classes names are identifiers in js.
SCOPE : In JavaScript, scope refers to the context in which variables and functions are accessible. It determines the visibility and lifetime of these variables and functions within your code. There are three main types of scope in JavaScript.
Global Scope:.
Variables declared outside any function or block have global scope.
These variables are accessible from anywhere in the code
example :
let globalVar = "I'm global";
function test() {
console.log(globalVar); // Accessible here
}
test();
console.log(globalVar); // Accessible here too
Function Scope
Variables declared within a function are local to that function.
They cannot be accessed from outside the function.
example :
function test() {
let localVar = "I'm local";
console.log(localVar); // Accessible here
}
test();
console.log(localVar); // Error: localVar is not defined
Block Scope:
Introduced with ES6, variables declared with let or const within a block (e.g., inside {}) are only accessible within that block
example :
{
let blockVar = "I'm block-scoped";
console.log(blockVar); // Accessible here
}
console.log(blockVar); // Error: blockVar is not defined
Keywords | Reserved Words
Keywords are reserved words in JavaScript that cannot use to indicate variable labels or function names.
Variables
variables ==> stored values ==> it will stored to ram / It will create separate memory.so we need memory address for access the values.
Stores Anything : JavaScript will store any value in the variable.
Declaring Variable :
* Var
* let
* const
we can declare variable using above keywords:
Initialize Variable :
Using assignment operator to assign the value to the variables.
var text = "hello";
React- Router is used for render the components depends on URL without reloading the browser page. It navigates a page to another page without page reloads. we can use router in react project, first we install the react-router-dom package from react.
Then, access the router using
import {BrowserRouter,Router,Routes} from 'react-router-dom';
after that we use link to diplay the browser using Link instead <a href=''>in react.
so,
import {BrowserRouter,Router,Routes,Link} from ‘react-router-dom’;
example for using Link and routes:
Using Links:
'/' is the root page it display default home page
<Link to='/'>Home</Link>
<Link to='/about'>About</Link>
<Link to='/contact'>Contact</Link>
React- Router is used for render the components depends on URL without reloading the browser page. It navigates a page to another page without page reloads. we can use router in react project, first we install the react-router-dom package from react.
Then, access the router using
import {BrowserRouter,Router,Routes} from 'react-router-dom';
after that we use link to diplay the browser using Link instead <a href=''>in react.
so,
import {BrowserRouter,Router,Routes,Link} from ‘react-router-dom’;
example for using Link and routes:
Using Links:
'/' is the root page it display default home page
<Link to='/'>Home</Link>
<Link to='/about'>About</Link>
<Link to='/contact'>Contact</Link>
# Install the public key for the repository (if not done previously): curl -fsS https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo gpg --dearmor -o /usr/share/keyrings/packages-pgadmin-org.gpg
# Install the public key for the repository (if not done previously): curl -fsS https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo gpg --dearmor -o /usr/share/keyrings/packages-pgadmin-org.gpg
I’m experiencing an issue with Eclipse where it closes automatically when I use ‘System.out.println’.
Environment : Eclipse Version: eclipse 2024-03 is the latest version of Eclipse today I reinstalled it. I downloaded Eclipse from the official Eclipse Foundation website at Eclipse Downloads | The Eclipse Foundation 1.
JDK version : java 22.0.1 2024-04-16 Java SE Runtime Environment (build 22.0.1+8-16) Java HotSpot 64-Bit Server VM (build 22.0.1+8-16, mixed mode, sharing)
Operating System: Ubuntu Ubuntu 22.04.4 LTS
Problem Description: Whenever I run a simple Java program that uses System.out.println. Eclipse hung and closed automatically without getting any error messages.
How i fix this issue
I fix this issue
Hi everyone,
I recently encountered a problem with Eclipse. when I upgraded Ubuntu 20 to Ubuntu 22 then some applications did not work properly . After some troubleshooting, I discovered that switching from Wayland to X11 resolved the issue. Here’s how you can do it:
How to Switch from Wayland to X11 on Ubuntu
If you’re experiencing issues with Wayland and want to switch back to X11, follow these steps:
Turn off Wayland and switch back to X11.
Log out of Ubuntu.
Start to log in again and click the icon that has appeared at the bottom right of the screen – that gives you the option to disable Wayland.
Switch back to Xorg.
Switching to X11 fixed the issues I was having, so I hope this helps anyone experiencing similar problems. Let me know if you have any questions or need further assistance!
I’m experiencing an issue with Eclipse where it closes automatically when I use ‘System.out.println’.
Environment : Eclipse Version: eclipse 2024-03 is the latest version of Eclipse today I reinstalled it. I downloaded Eclipse from the official Eclipse Foundation website at Eclipse Downloads | The Eclipse Foundation 1.
JDK version : java 22.0.1 2024-04-16 Java SE Runtime Environment (build 22.0.1+8-16) Java HotSpot 64-Bit Server VM (build 22.0.1+8-16, mixed mode, sharing)
Operating System: Ubuntu Ubuntu 22.04.4 LTS
Problem Description: Whenever I run a simple Java program that uses System.out.println. Eclipse hung and closed automatically without getting any error messages.
How i fix this issue
I fix this issue
Hi everyone,
I recently encountered a problem with Eclipse. when I upgraded Ubuntu 20 to Ubuntu 22 then some applications did not work properly . After some troubleshooting, I discovered that switching from Wayland to X11 resolved the issue. Here’s how you can do it:
How to Switch from Wayland to X11 on Ubuntu
If you’re experiencing issues with Wayland and want to switch back to X11, follow these steps:
Turn off Wayland and switch back to X11.
Log out of Ubuntu.
Start to log in again and click the icon that has appeared at the bottom right of the screen – that gives you the option to disable Wayland.
Switch back to Xorg.
Switching to X11 fixed the issues I was having, so I hope this helps anyone experiencing similar problems. Let me know if you have any questions or need further assistance!
A simple text scanner that can parse primitive types and strings using regular expressions. A Scanner breaks its input into tokens using a delimiter pattern, which by default matches whitespace. The resulting tokens may then be converted into values of different types using the various next methods.
Scanner sc = new Scanner(System.in); System.out.println("Enter the value:"); int value =sc.nextInt(); System.out.println(value);
A simple text scanner that can parse primitive types and strings using regular expressions. A Scanner breaks its input into tokens using a delimiter pattern, which by default matches whitespace. The resulting tokens may then be converted into values of different types using the various next methods.
Scanner sc = new Scanner(System.in); System.out.println("Enter the value:"); int value =sc.nextInt(); System.out.println(value);