CODE:
DEMO
![]() |
| Square Star Pattern in Javascript Demo |
CODE:
DEMO
![]() |
| Square Star Pattern in Javascript Demo |
Hi, I’m Vijay Chauhan, a web developer from India in love with all things internet. Online since 2015.
Q1 -- What is JavaScript?
Ans--- JavaScript is a scripting language used to make the website interactive
Q2 -- What is Node.js?
Ans--- It is a JavaScript runtime and open source , cross-platform environment for server development built on chrome’s V8 Engine
Q3 -- Which HTML tag links a JS file with an HTML file?
Ans--- script
Q4 -- What will be the output of the following code?
let a=3000;
console.log("I love you", a,"!");
Ans---I love you 3000 !Q5 -- Which of the following scoping type does JavaScript use?Ans--- Lexical
Hi, I’m Vijay Chauhan, a web developer from India in love with all things internet. Online since 2015.
It is a JavaScript runtime and open source , cross-platform environment for server development built on chrome’s V8 Engine
Hi, I’m Vijay Chauhan, a web developer from India in love with all things internet. Online since 2015.
JavaScript is a scripting language used to make the website interactive
Hi, I’m Vijay Chauhan, a web developer from India in love with all things internet. Online since 2015.
Method 1
<script>
let numbers_array = [11, 22, 33, 54, 55]; console.log("Original Array: "); console.log(numbers_array); numbers_array.reverse(); console.log("Reversed Array: "); console.log(numbers_array);</script>
Output:
Original Array:
[ 11, 22, 33, 44, 55 ]
Reversed Array:
[ 55, 44, 33, 22, 11 ]
Method 2
let original_array = [11, 22, 33, 44]; let reversed_array = []; console.log("Original Array: "); console.log(original_array); for (let i = original_array.length - 1; i >= 0; i--) { reversed_array.push(original_array[i]); } console.log("Reversed Array: "); console.log(reversed_array);
Output:
Original Array:
[ 11, 22, 33, 44, 55 ]
Reversed Array:
[ 55, 44, 33, 22, 11 ]
Method 3
let original_array = [11, 22, 33, 44, 55, 66]; let reversed_array = []; console.log("Original Array: ");console.log(original_array); original_array.forEach((element) => { reversed_array.unshift(element);}); console.log("Reversed Array: ");console.log(reversed_array);
Original Array:
[ 11, 22, 33, 44, 55,66 ]
Reversed Array:
[66, 55, 44, 33, 22, 11 ]
Hi, I’m Vijay Chauhan, a web developer from India in love with all things internet. Online since 2015.
An HTML elements is defined by a star tag , some content , and an end tag .
< tagname > content goes here ..... < /tagname >
The HTML elements is everything from the start tag to the end tag :
< h1 > first heading < h 1>
< p > my first paragraph < /p >
START TAG ELEMENT CONTENT END TAG
< h1 > my first heading </h1>
<p> my first paragraph </p>
<br> none none
Hi, I’m Vijay Chauhan, a web developer from India in love with all things internet. Online since 2015.
HTML is Hyper Text Markup Language.
HTML tag,
HTML,
Body,
Title
Hi, I’m Vijay Chauhan, a web developer from India in love with all things internet. Online since 2015.
Hi, I’m Vijay Chauhan, a web developer from India in love with all things internet. Online since 2015.
Javascript Function :
var currDate =01/03/2023
var date_birth = 04/03/1994
function isLessThan18(currDate, date_birth)
{
var currday=parseInt(currDate.substring(0,2),10);
var currMnth=parseInt(currDate.substring(3,5),10);
var currYear=parseInt(currDate.substring(6,10),10);
var dobDay=parseInt(date_birth.substring(0,2),10);
var dobMon=parseInt(date_birth.substring(3,5),10);
var dobYear=parseInt(date_birth.substring(6,10),10);
if(currYear-dobYear<18)
{
return true;
}
else if(currYear-dobYear>18)
{
return false;
}
else if(currYear-dobYear==18)
{
if(currMnth>dobMon)
{
return false;
}
else if(currMnth<dobMon)
{
return true;
}
else if(currMnth==dobMon)
{
if(currday<dobDay)
{
return true;
}
else if(currday>=dobDay)
{
return false;
}
}
}
}
Hi, I’m Vijay Chauhan, a web developer from India in love with all things internet. Online since 2015.
You can clear _SESSION
<?php
session_start();
session_destroy();
$_SESSION = [];
echo '<h1>You have been successfully remove session</h1>';
?>
Hi, I’m Vijay Chauhan, a web developer from India in love with all things internet. Online since 2015.
Data Definition Language (DDL) : CREATE , ALTER , DROP (tables, views, procedures, triggers). Data Manipulation Language (DML) : SELECT ,...