Javascript Was Developed by Netscape Communications Corporation, A Now-Defunct Technology Company. It Was Created by Brendan Eich in 1995
Javascript Was Developed by Netscape Communications Corporation, A Now-Defunct Technology Company. It Was Created by Brendan Eich in 1995
Javascript Was Developed by Netscape Communications Corporation, A Now-Defunct Technology Company. It Was Created by Brendan Eich in 1995
Object: Represents a collection of key-value pairs. Objects can include functions, arrays, and other
objects.
Array: Represents an ordered list of values, accessed by their numeric index.
Function: Represents a block of code that can be invoked or executed.
Date: Represents a specific point in time.
RegExp: Represents a regular expression, used for pattern matching in strings.
Map: Represents a collection of key-value pairs with keys that can be of any data type.
Set: Represents a collection of unique values.
WeakMap: Similar to a Map, but with weaker object references, allowing objects to be garbage
collected if there are no other references to them.
WeakSet: Similar to a Set, but with weaker object references.
How to declare variable in Javascript?
In JavaScript, you can declare a variable using the `var`, `let`, or `const` keywords. Here's how you can
use each of them to declare variables:
```javascript
var variableName = value;
```
2. **Using `let`:**
The `let` keyword was introduced in ECMAScript 6 (ES6) to address some of the scope-related
problems of `var`. It's used for declaring variables that can be reassigned.
```javascript
let variableName = value;
```
3. **Using `const`:**
The `const` keyword, also introduced in ES6, is used for declaring variables whose values cannot be
reassigned after initialization. This is useful for creating constants.
```javascript
const constantName = value;
```
```javascript
// Using var
var nameVar = "John";
nameVar = "Alice"; // This is allowed, but generally discouraged due to scope issues
// Using let
let age = 25;
age = 26; // Reassignment is allowed
// Using const
const pi = 3.14159;
// pi = 3.14; // This will result in an error since constants cannot be reassigned
```
What are arithmetical operators?
1. **Addition (`+`):** Adds two values together.
```javascript
const sum = 5 + 3; // Result: 8
```
6. **Exponentiation (`**`):** Raises the first value to the power of the second.
```javascript
const power = 2 ** 3; // Result: 8 (2 raised to the power of 3)
```
```javascript
const result = (10 + 5) * 2; // Result: 30 (15 * 2)
```
write simple javascripts with html for expression evalution and massage printing ?
<!DOCTYPE html>
<html>
<head>
<title>Expression Evaluation</title>
</head>
<body>
<h1>Expression Evaluation</h1>
<p id="result"></p>
<script>
function evaluateExpression() {
const expressionInput = document.getElementById('expression');
const resultParagraph = document.getElementById('result');