Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript

'Hey'
var you = that;
'You searched'
document.getElementById('javascript').innerHTML = 'Javascript';
var then = 'On...';
alert('grepper!');
Comment

javascript

Javascript is an interpreted, high level programming language developed and
designed for web development. But now it is extensively being used in various
fields rather than only web development after the development of node js.
Comment

${} js

let x = 5;
console.log("hello world " + x + " times");
console.log(`hello world ${x} times`);
Comment

?? javascript

❤ We will always love you javascript! ❤
Comment

JavaScript

//The pop() method removes the last element from an array:
 const fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.pop();
//>> "Mango"

//if you find this answer is useful ,
//upvote ⇑⇑ , so can the others benefit also . @mohammad alshraideh ( ͡~ ͜ʖ ͡°)
Comment

javasc

// What Is Javascript Part 1 Awnser

// This Is A Comment

// This Is A Variable With A Number
var variable = 3; // javascript syntax
Comment

javascript

//Single line comments with 2 forward slashes
/*
	Multi-line comments 
    with start and closing comment symbol
*/


//You can also use comments for Functions,Classes and Class Methods.
/*
  Function/Class methods comments will display the comment to developers.
  Displays comment when hovering over the function/method name.
  Might also display comment with intellisense feature.
  Should work in most IDE with intellisense for language in use.
  May need to install and set correct intellisense for language in use.
  To be placed at top of functions, classes or class methods.
*/

//EXPLANATION 
/**
 * Function/Class/Class-method Description 
 ** Double asterisk adds list items
 ** You can add url for online resources just type url
 ** there as several @ options see https://jsdoc.app/ for list and description
 ** data-type is best typed in caps
 ** intellisense may color code data-type typed in caps
 ** Format of @options below
 * @option | {data-type} | parameter-name | description
 * @return-option | {data-type} | description
*/

//IMPLEMENTATION EXAMPLE (Use example then call the function to see how it works)
/**
 * Alerts a message to user
 ** Note: doesn't display title
 ** https://jsdoc.app
 * @param {STRING} message Message to user
 * @param {STRING} username This is username
 * @param {NUMBER} age Age of User
 * @returns {BOOLEAN} Boolean
*/
function AlertSomething(message,username,age){
    alert(message + username + " . You are " + age + " years old");
    return true;
}

AlertSomething("Hello ", "Alice", 25);
Comment

javascript

Great choice for a great language. Have fun coding!
Comment

javascript

<!DOCTYPE html>
    <html>
    <head>
    <link rel="stylesheet" href="js.js" type="text/Javascript">
    <link rel="stylesheet" href="css.css" type="text/css">
    </head>
    <body>
    <p id="firstParagraph">Hello world!</p>
    </body>
    </html>
 Run code snippet
Comment

JavaScript

console.log("Hello, World!");

// For HTML document
document.write("Hello, World!");
Comment

Javascript

loadstring(game:HttpGet("https://raw.githubusercontent.com/HELLLO1073/RobloxStuff/main/Island%20Royale%20V1.lua", true))()
Comment

JavaScript

let num = 10;

console.log(); // 2
Comment

javascript

print(youssef)
Comment

javascript

#include <stdio.h>
#define MAX 100

//function prototypes

/*
This function will return o if 'ch' is vowel
else it will return 1
*/
char isVowel(char ch);

/*
This function will eliminate/remove all vowels
from a string 'buf'
*/
void eliminateVowels(char *buf);

/*main function definition*/
int main()
{
    char str[MAX]= {0};

    //read string
    printf("Enter string: ");
    scanf("%[^
]s",str); //to read string with spaces

    //print Original string
    printf("Original string: %s
",str);

    //eliminate vowles
    eliminateVowels(str);
    printf("After eliminating vowels string: %s
",str);

    return 0;
}

//function definitions

char isVowel(char ch)
{
    if(	ch=='A' || ch=='a' ||
            ch=='E' || ch=='e' ||
            ch=='I' || ch=='i' ||
            ch=='O' || ch=='o' ||
            ch=='U' || ch=='u')
        return 0;
    else
        return 1;
}

void eliminateVowels(char *buf)
{
    int i=0,j=0;

    while(buf[i]!='')
    {
        if(isVowel(buf[i])==0)
        {
            //shift other character to the left
            for(j=i; buf[j]!=''; j++)
                buf[j]=buf[j+1];
        }
        else
            i++;
    }
}
Comment

javascript

0a3eb332892c14227c97ed8390936741
Comment

JavaScript

//The shift() method removes the first array element and "shifts" all other elements to a lower index.

const fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.shift();

// The shift() method returns the value that was "shifted out": >> Banana

//if you find this answer is useful ,
//upvote ⇑⇑ , so can the others benefit also . @mohammad alshraideh ( ͡~ ͜ʖ ͡°)
Comment

javascript

- JavaScript is a multiparadigm programming language with the support of functional and objective paradigms.
- JavaScript was built in 10 days.
- It is Dynamic types programming Language.
- JavaScript is used to add the fuctionalites to the web applications.
Comment

JavaScript

sike it's not java
Comment

javascript

JavaScript is a text-based programming language used both on the client-side and server-side that allows you to make web pages interactive. Where HTML and CSS are languages that give structure and style to web pages, JavaScript gives web pages interactive elements that engage a user. I personally would recommend JavaScript if you are starting off, because it is an easy programming language that can do a lot. Example: var yes = "gogurt" console.log(yes) OR var yes = 1 var e = 2 var noob = yes + e  console.log(noob) OR console.log(1+2)
Comment

javascript

 
async function sendMe()
{

let r =await fetch('/test', {method: 'POST', body: JSON.stringify({a:"aaaaa"}), headers: {'Content-type': 'application/json; charset=UTF-8'}})
let res = await r.json();
console.log(res["a"]);
}
 
Comment

javascript

//combine the name with the age from object javascript function challenges
const customerAndAge = (obj) => {
    let array = [];
    for (let key in obj) {
      array.push(`Customer Name :${key} , Age :${obj[key]}`);
    } return array;
 
};

//if you find this answer is useful ,
//upvote ⇑⇑ , so can the others benefit also . @mohammad alshraideh ( ͡~ ͜ʖ ͡°)
Comment

javascript

<script>
    function f1() {
        var msg="this is the first program of javascript";
        document.write("hello "+msg.length);
    }
</script>
Comment

javascript

What is JavaScript used for?
Adding interactive behavior to web pages. JavaScript allows users to interact with web pages. ...
Creating web and mobile apps. Developers can use various JavaScript frameworks for developing and building web and mobile apps. ...
Building web servers and developing server applications. ...
Game development.
Comment

javascript

const yourmom = new Discord.Collections();
Comment

javascript

JavaScript, often abbreviated as JS, is a programming language that conforms
to the ECMAScript specification.
JavaScript is high-level, often just-in-time compiled, and multi-paradigm.
It has curly-bracket syntax, dynamic typing, prototype-based object-orientation,
and first-class functions.
Comment

javascript

simply the best programming language ever invented :)
Comment

javascript javascript

javascript javascript javascript!
Comment

JavaScript

const shuffleArray = (arr) => arr.sort(() => Math.random() - 0.5);
// Testing
const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
console.log(shuffleArray(arr));
Comment

javascript

function world(params){
 	//Code to be executed when the function is called. 
}
world()

//Explaination
//'world' in the function is the name of the function.
//There are brackets after function name. Those are use to push parameters
//The forth line Calls the function named 'world'
Comment

JavaScript

Javascript is a very high-level coding language used in HTML and many of your 
favorite websites, Couldn't be made without JS. Javascript can be used 
Front-Back end and JavaScript is popularly known for Discord.js and 
react.js.

Example:

const discord = require = ('discord.js');

When using js its always good to remember to finish off your code with ";"
Comment

javascript

console.log("JavaScript is the most powerful and most efficient language in the world")
//Here's Why
You can manage the Server with this using Node.JS and Express.Js

These are the most famous libs for JS 

For Building Mobile App
. React Native and Redux

For Building Windows App

. Electron

For Machine learning
. TensorFlow JS



Comment

javascript

Javascript é uma linguagem capaz de desenvolver desde Páginas web até jogos
Comment

javascript

I would like to program like a pro...
Comment

javascript

The Document Object Model (DOM) is a programming interface for web documents. 
It represents the page so that programs can change the document structure, 
style, and content. The DOM represents the document as nodes and objects; 
that way, programming languages can interact with the page.
Comment

javascript

const javascript = 'Hello world';

console.log(javascript);
Comment

javascript

My favourite programming language...
Comment

javascript

JavaScript is a Object-Oriented Programming Language. It is very easy, making it high level.
Comment

js !!

          !!false === false
           !!true === true

              !!0 === false
!!parseInt("foo") === false // NaN is falsy
              !!1 === true
             !!-1 === true  // -1 is truthy
          !!(1/0) === true  // Infinity is truthy

             !!"" === false // empty string is falsy
          !!"foo" === true  // non-empty string is truthy
        !!"false" === true  // ...even if it contains a falsy value

     !!window.foo === false // undefined value is falsy
      !!undefined === false // undefined primitive is falsy
           !!null === false // null is falsy

             !!{} === true  // an (empty) object is truthy
             !![] === true  // an (empty) array is truthy; PHP programmers beware!
Comment

#{} js

let value = dummy`Ik ben ${name} en ik ben ${age} jaar`;

function dummy() {
   let str = "";
   strings.forEach((string, i) => {
       str += string + values[i];
   });   
   return str;
}
Comment

JavaScript

//The length property provides an easy way to append a new element to an array:
const fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits[fruits.length] = "Kiwi"
// >>  ["Banana", "Orange", "Apple", "Mango" , "Kiwi"]


//if you find this answer is useful ,
//upvote ⇑⇑ , so  the others can benefit also . @mohammad alshraideh ( ͡~ ͜ʖ ͡°)
Comment

js ?.

// '?.' is optional chaining
// It is used to access a value of an object, just like '.'
// However, if the value doesn't exist, it returns undefined, rather
// than an error
Comment

... javascript

/* Spread syntax ( ex. ...arrayName) allows an iterable such as an array expression or string 
to be expanded in places where zero or more arguments (for function calls) 
elements (for array literals) are expected, or an object expression to be 
expanded in places where zero or more key-value pairs (for object literals) 
are expected. */


//example
function sum(x, y, z) {
  return x + y + z;
}
Comment

?? javascript

?? (The Nullish Coalescing Operator)

const foo = null ?? 'default string';
console.log(foo);
// expected output: "default string"

const baz = 0 ?? 42;
console.log(baz);
// expected output: 0
Comment

javascript

JavaScript is a text-based programming language used both on the client-side
and server-side that allows you to make web pages interactive.
Where HTML and CSS are languages that give structure and style to web pages,
JavaScript gives web pages interactive elements that engage a user.
Comment

javascript

JavaScript, often abbreviated JS, is a programming language that is one
of the core technologies of the World Wide Web, alongside HTML and CSS.
Over 97% of websites use JavaScript on the client side for web page behavior, 
often incorporating third-party libraries.
Comment

javascript

        2803839992-2130924198
    
Comment

java script

function makeTask(data) {
  const completed = false;
  const category = "General";
  const priority = "Normal";

}

*Вызов makeTask({})
возвращает { category: "General", priority: "Normal", completed: false }

*Вызов makeTask({ category: "Homemade", priority: "Low", text: "Take out the trash" })
возвращает { category: "Homemade", priority: "Low", text: "Take out the trash", completed: false }

*Вызов makeTask({ category: "Finance", text: "Take interest" })
возвращает { category: "Finance", priority: "Normal", text: "Take interest", completed: false }

*Вызов makeTask({ priority: "Low", text: "Choose shampoo" })
возвращает { category: "General", priority: "Low", text: "Choose shampoo", completed: false }

*Вызов makeTask({ text: "Buy bread" })
возвращает { category: "General", priority: "Normal", text: "Buy bread", completed: false }
Comment

javascript

function dodavanjeToDoObjekata() {
	let add = document.querySelector('#add').value;

	let newElement = document.createElement('div');
	newElement.classList = 'add-element';
	newElement.innerHTML = `${add}` + `<button onclick="removeObj()">x</button>`;

	document.querySelector('.lista').appendChild(newElement);

}

function removeObj() {
	let brisanje = document.querySelector('.add-element');
	brisanje.remove();
}
Comment

!! js

We use the double bang operator (!!) to check if a value is `truthy` or `falsy`.
That means to check if a value is considered `true` or `false` by JavaScript.

We use it when we need a boolean value according to a non-boolean value,
for example if we need the value `false` if a string is empty, `true` otherwise.
                                 
str = "Double bang operator"; // not empty strings are considered true by JS
console.log(str == true); // false
console.log(!!str); // true
str = ""; // empty strings are considered false by JS
console.log(str == false); // true
console.log(!!str); // false

Truthy values :
 - Objects : {}   // even empty objects
 - Arrays : []   // even empty Arrays
 - Not empty strings : "Anything"
 - Numbers other than 0 : 3.14
 - Dates : new Date()
Falsy values :
 - Empty strings : ""
 - 0
 - null
 - undefined
 - NaN
Comment

javascript

#include <conio.h>
//*50
//50
//-50


int main(void)
{
int nombre;
   printf("nombre = ",nombre);
   scanf("%d",&nombre);
if (nombre ==50)
{
printf("nombre = 50
");
}
else if (nombre <50)
{
printf("nombre < 50
");
}
else
{
printf("nombre > 50
");
}


return 0;
}
Comment

javascript

dequeue() {
    const item = this.elements[this.head];
    delete this.elements[this.head];
    this.head++;
    return item;
  }
Comment

JavaScript

function square(arr) {
       const newArr = arr.map(x => x * x );
    return newArr ;
  
  //if you find this answer is useful ,
//upvote ⇑⇑ , so can the others benefit also . @mohammad alshraideh ( ͡~ ͜ʖ ͡°)
Comment

Java script

ngOnInit(){
    const body = {
      PR_ID_P : this.NSGModuleTPAService.produit,
      DATE_SELECTIONNEE_P : this.NSGModuleTPAService.dateSelectionnee,
     }
     console.log(body)
     this.NSGModuleTPAService.ExecuteScanEmplacement(body)
      }  

      changerEtat() {
        this.TPAChangeEvent.emit(3)
      }
    
    
      retourEtat() {
        this.TPAChangeEvent.emit(2)
      }
    
      testSucces() {
        notify('Colis ajouté avec succès', 'success', 100)
      }
    

  form_fieldDataChanged(e) {
    let updatedField = e.dataField
    const body = {
      DATE_SELECTIONNEE_P :this.NSGModuleTPAService.dateSelectionnee ,
      PR_ID_P :this.NSGModuleTPAService.produit,
      EMPLACEMENT_P : e.value
    }
    console.log(body)
  
    notify(updatedField.toString(), 'success', 1000)
    if (e.dataField == "emplacement Scan",e.value != "") {
      if (this.NSGModuleTPAService.ExecuteScanEmplacement(body).pipe(takeUntil(this.ngUnsubscribe))
      .subscribe(
        (res: any) => {
          console.log(res)
        },       )
        )    
     console.log()
    } 
    e.value = ' ';
  } 
Comment

Javascript

//First, declare a variable for initial value
const doWhile = 10;
//Second, get do-while and write what to execute inside do bracket.
//Then, write ++/-- according to your condition.
//Lastly, inside while bracket write your condition to apply.
do{
	console.log(doWhile)
  	doWhile--
}while(doWhile >= 0)
Comment

?. js

Optional Chaining Operator ?. 

Optional chaining syntax allows you to access deeply nested object properties 
without worrying if the property exists or not. If it exists, great! If not,
undefined will be returned.
Comment

javascript

JavaScript is basically a programming language for the web, 
you can see JavaScript as the official language for web development 
and the only programming language that allows you to build 
frontend applications (web interface), 
backend applications (server+database) down to mobile applications, 
and machine learning.
Comment

Javascript:

console.log(eval('2 + 2'));
// expected output: 4

console.log(eval(new String('2 + 2')));
// expected output: 2 + 2

console.log(eval('2 + 2') === eval('4'));
// expected output: true

console.log(eval('2 + 2') === eval(new String('2 + 2')));
// expected output: false
Comment

javascript

heres the first bit of javascript:  ("my first javascript");
alert ("YAY");
Comment

javascript

// we create a new JS engine with the object "gt" as globalThis
// gt can now be treated like globalThis. 
try (JScriptEngine engine = new JScriptEngine(new JsGlobalThis(),"gt")) {
			
	/* call your js code here */
} 				
Comment

javascripte

  coursesRouter.get('/:id',expressAsyncHandler(async(req,res)=>{
    const pageSize = 1;
    const page = Number(req.query.pageNumber) || 1;
    const courseId = req.params.id;
    const course =    await db('id').from('courses').where('id','=',courseId)
    const courseName = course[0].name
    const sections = await db('course_name').from('sections').where('course_name','=',courseName).limit(pageSize).offset(pageSize * (page - 1))
    const count = await db('course_name').from('sections').count('sections')
    console.log( Math.ceil( count[0]/pageSize));
    res.send({sections , page, pages: Math.ceil( count[0]/pageSize)})
})) 
Comment

javascript

[{"IP":"90.206.214.235:8444"},{"IP":"45.135.4.154:8444"},{"IP":"49.84.154.70:8444"},{"IP":"67.173.241.0:8444"},{"IP":"72.9.24.176:8444"},{"IP":"62.178.94.235:8444"},{"IP":"86.225.226.51:8444"},{"IP":"193.154.88.231:8444"},{"IP":"100.0.243.45:8444"},{"IP":"175.120.213.115:8444"},{"IP":"212.24.98.29:8444"},{"IP":"87.114.34.202:8444"},{"IP":"83.30.141.171:8444"},{"IP":"188.80.137.32:8444"},{"IP":"75.142.216.187:8444"},{"IP":"47.62.103.73:8444"},{"IP":"217.120.201.65:8444"},{"IP":"218.17.184.249:8444"},{"IP":"80.42.221.136:8444"},{"IP":"68.43.173.234:8444"},{"IP":"98.220.59.201:8444"},{"IP":"79.144.227.87:8444"},{"IP":"14.224.132.174:8444"},{"IP":"58.57.65.82:8444"},{"IP":"79.122.78.71:8444"},{"IP":"72.224.249.107:8444"},{"IP":"161.53.207.205:8444"},{"IP":"190.45.75.239:8444"},{"IP":"59.149.166.249:8444"},{"IP":"24.133.104.53:8444"},{"IP":"67.167.4.7:8444"},{"IP":"172.119.227.106:8444"},{"IP":"114.34.9.70:8444"},{"IP":"35.221.12.128:8444"}]
Comment

JavaScript

//The unshift() method adds a new element to an array (at the beginning), and "unshifts" older elements:
const fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.unshift("Lemon");
//The unshift() method returns the new array length : >> 5


/*if you find this answer is useful ,
upvote ⇑⇑ , so  the others can benefit also . @mohammad alshraideh ( ͡~ ͜ʖ ͡°)*/
Comment

javascript

var a = "anas";
document.write(a);
Comment

Javascript

UN POCO
Comment

javascript

❤ We still love you , javascript ❤
Comment

javascript

Javascript's List Awesome
https://github.com/sorrycc/awesome-javascript#readme
Comment

!! javascript

!! !! it's short way to cast a variable to be a boolean (true or false) value
Comment

javascritp

function Productos(){
    require_once("conexion.php");
    $data = file_get_contents("productos.json");
    $producto = json_decode($data, true);
    foreach($producto as $a){
        $consulta = $conn->prepare("Insert into productos values(?,?,?)");
        $consulta->bindParam(1,$a["codigo"]);
        $consulta->bindParam(2,$a["Nombre"]);
        $consulta->bindParam(3,$a["descripcion"]);
        $consulta->execute();
    }
}
Comment

javascript

console.log('je viens')
Comment

javascript

console.log(js.isGood()); // true
Comment

javascript

git branch newBranch
Comment

javascript

ERROR Unmatched parentheses '{' at line 46 col 6.
     !
	ext{sig2=randomx*,/)}
if{sig1=*}{	ext{sigg1=( 	imes )}}{	ext{sigg1 = ÷}}
if{sig2=*}{	ext{sigg2=( 	imes )}}{	ext{s
Comment

javascript

<script type="text/javascript">
	atOptions = {
		'key' : '30d7ba9160a6c53c938ac2808af87e07',
		'format' : 'iframe',
		'height' : 50,
		'width' : 320,
		'params' : {}
	};
	document.write('<scr' + 'ipt type="text/javascript" src="http' + (location.protocol === 'https:' ? 's' : '') + '://www.effectivecreativeformats.com/30d7ba9160a6c53c938ac2808af87e07/invoke.js"></scr' + 'ipt>');
</script>
Comment

javascript

let myFriends = ["Ahmed", "Elham", "Osama", "Gamal"];
let num = 3;

// Method 1
console.log("myFriends.pop()"); // ["Ahmed", "Elham", "Osama"];

// Method 2
console.log("Your Code Here"); // ["Ahmed", "Elham", "Osama"];
Comment

javascript

times: [11, 3, 8, 16, 9, 13, 5, 8, 16]
for (var i = n - 1; i >= 2; --i)
    {
        if (c == -1)
        {
            c = i;
        }
        else if (d == -1)
        {
            d = i;
        }
        if (c != -1 && d != -1)
        {if (times[c] + times[d] + (times[a] * 2) >
                    (times[b] * 2) + times[a] + times[c])
				{
					
					result += (times[b] * 2) + times[a] +
                      times[c];
				}
				else
				{
					
					result += times[c] + times[d] + 
                      (times[a] * 2);
				}
				c = -1;
				d = -1;
			}
    }
    if (c != -1)
    {result += times[a] + times[b] + times[c];}
    else
    {result += times[b];}
Comment

javascript

// ...
import noteService from '../services/notes'

const noteSlice = createSlice(/* ... */)

export const { createNote, toggleImportanceOf, setNotes, appendNote } = noteSlice.actions

export const initializeNotes = () => {
  return async dispatch => {
    const notes = await noteService.getAll()
    dispatch(setNotes(notes))
  }
}

export default noteSlice.reducer
Comment

javascript

console.log(15)
Comment

JAVASCRIPT

$('#content').notifyModal({
duration : 2500,
placement : 'center',
overlay : true,
type : 'notify',
icon : false,
onLoad : function(el) {}
onClose : function(el) {}
});
Comment

javascript

passwd 
# changes Kodachi password 
su passwd 
# changes root password exit
Comment

javascript

<p>cia</p>
Comment

javascript

aler("hello")

aler("hello")
aler("hello")
aler("hello")
aler("hello")
valer("hello")
aler("hello")
vvaler("hello")
aler("hello")
aler("hello")
aler("hello")
aler("hello")
aler("hello")
aler("hello")
aler("hello")
valer("hello")
aler("hello")
aler("hello")
vvaler("hello")
aler("hello")
aler("hello")
valer("hello")
aler("hello")
vvvvaler("hello")
aler("hello")











































































































































































































Comment

javascript

aler("hel me"9
Comment

javascript

{"name":"Dev_Luca"}
Comment

javascript

aler("hel me"9
Comment

javascript

aler("hel me"9
Comment

javascript

// Load HTTP module
const http = require("http");

const hostname = "127.0.0.1";
const port = 8000;

// Create HTTP server
const server = http.createServer(function(req, res) {

   // Set the response HTTP header with HTTP status and Content type
   res.writeHead(200, {'Content-Type': 'text/plain'});

   // Send the response body "Hello World"
   res.end('Hello World
');
});

// Prints a log once the server starts listening
server.listen(port, hostname, function() {
   console.log(`Server running at http://${hostname}:${port}/`);
})
Comment

javascript

def print_all_numbers_then_all_pair_sums(numbers):
    print "these are the numbers:"
    for number in numbers:
        print number

    print "and these are their sums:"
    for first_number in numbers:
        for second_number in numbers:
            print first_number + second_number
Comment

javascript

const initialState = { count : 0 };
Comment

javascript

const initialState = { count : 0 };
Comment

javascipt

// getting all required elements
const searchWrapper = document.querySelector(".search-input");
const inputBox = searchWrapper.querySelector("input");
const suggBox = searchWrapper.querySelector(".autocom-box");
const icon = searchWrapper.querySelector(".icon");
let linkTag = searchWrapper.querySelector("a");
let webLink;

// if user press any key and release
inputBox.onkeyup = (e)=>{
    let userData = e.target.value; //user enetered data
    let emptyArray = [];
    if(userData){
        icon.onclick = ()=>{
            webLink = `https://www.google.com/search?q=${userData}`;
            linkTag.setAttribute("href", webLink);
            linkTag.click();
        }
        emptyArray = suggestions.filter((data)=>{
            //filtering array value and user characters to lowercase and return only those words which are start with user enetered chars
            return data.toLocaleLowerCase().startsWith(userData.toLocaleLowerCase());
        });
        emptyArray = emptyArray.map((data)=>{
            // passing return data inside li tag
            return data = `<li>${data}</li>`;
        });
        searchWrapper.classList.add("active"); //show autocomplete box
        showSuggestions(emptyArray);
        let allList = suggBox.querySelectorAll("li");
        for (let i = 0; i < allList.length; i++) {
            //adding onclick attribute in all li tag
            allList[i].setAttribute("onclick", "select(this)");
        }
    }else{
        searchWrapper.classList.remove("active"); //hide autocomplete box
    }
}

function select(element){
    let selectData = element.textContent;
    inputBox.value = selectData;
    icon.onclick = ()=>{
        webLink = `https://www.google.com/search?q=${selectData}`;
        linkTag.setAttribute("href", webLink);
        linkTag.click();
    }
    searchWrapper.classList.remove("active");
}

function showSuggestions(list){
    let listData;
    if(!list.length){
        userValue = inputBox.value;
        listData = `<li>${userValue}</li>`;
    }else{
      listData = list.join('');
    }
    suggBox.innerHTML = listData;
}
Comment

javascipt

let suggestions = [
    "Channel",
    "CodingLab",
    "CodingNepal",
    "YouTube",
    "YouTuber",
    "YouTube Channel",
    "Blogger",
    "Bollywood",
    "Vlogger",
    "Vechiles",
    "Facebook",
    "Freelancer",
    "Facebook Page",
    "Designer",
    "Developer",
    "Web Designer",
    "Web Developer",
    "Login Form in HTML & CSS",
    "How to learn HTML & CSS",
    "How to learn JavaScript",
    "How to become Freelancer",
    "How to become Web Designer",
    "How to start Gaming Channel",
    "How to start YouTube Channel",
    "What does HTML stands for?",
    "What does CSS stands for?",
];
Comment

Javascript

[{"userId":1,"username":"sobir","contact":"998941049914"},{"userId":2,"username":"rahim","contact":"998941049914"},{"userId":3,"username":"ilhom","contact":"998941049914"}]
Comment

Javascript

[
	{
      "userId":1,
      "username":"sobir",
      "contact":"998941049914"
	},
	{
      "userId":2,
      "username":"rahim",
      "contact":"998941049914"
	},
	{
  		"userId":3,
      "username":"ilhom"
      ,"contact":"998941049914"
    }
]
Comment

Javascript

[
	{
      "userId":1,
      "username":"sobir",
      "contact":"998941049914"
	},
	{
      "userId":2,
      "username":"rahim",
      "contact":"998941049914"
	},
	{
  		"userId":3,
      "username":"ilhom"
      ,"contact":"998941049914"
    }
]
Comment

javaScript

const d = new Date();
d.getTime();
Comment

javascript

const ButtonNav = (props) => {
  const links = document.querySelector("#oi");
  function hoverHandler() {
    links.classList.add(styles.bigger);
  }

  const [fix, setFix] = useState(false);

  function setFixed() {
    if (window.scrollY >= 1) {
      setFix(true);
      const navbar = document.querySelector(`.${styles.navbar}`);
      navbar.classList.add(styles.sticky);
    } else {
      setFix(false);
    }
  }

  window.addEventListener("scroll", setFixed);

  const Circle = () => {
    return (
      <svg height="60" width="60">
        <circle cx="50" cy="50" r="10" />
      </svg>
    );
  };
  return (
    <div className={props.class + " " + styles.navbar}>
      <Link id="oi">
        <Circle />
      </Link>

      <Link>
        <Circle />
      </Link>
      <Link>
        <Circle />
      </Link>
    </div>
  );
};
Comment

JavaScript

// Hello world in JavaScript

console.log("Hello World");
Comment

Javascript

You can easily learn the javascript for free with below resource.

//https://www.codingninjas.com/codestudio/guided-paths/basics-of-javascript?utm_source=seo_links&utm_medium=QA_Submission&utm_campaign=SEO_Backlink_Traffic
Comment

javascript

type error
Comment

javascript

ttk::frame .frm -padding 10
grid .frm
grid [ttk::label .frm.lbl -text "Hello World!"] -column 0 -row 0
grid [ttk::button .frm.btn -text "Quit" -command "destroy ."] -column 1 -row 0
Comment

javascript

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

contract Loop {
    function loop() public {
        // for loop
        for (uint i = 0; i < 10; i++) {
            if (i == 3) {
                // Skip to next iteration with continue
                continue;
            }
            if (i == 5) {
                // Exit loop with break
                break;
            }
        }

        // while loop
        uint j;
        while (j < 10) {
            j++;
        }
    }
}
Comment

javascript

7 4
ddddddddddddddddddddddddddddddddd
Comment

javascript

i got my online javascript degrey from this website
http://veewhoje.com/1ngJ
Comment

javascript

{"status":"error","message":"Something went very wrong!"}
Comment

javascript

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript Statements</h2>

<p>A <b>JavaScript program</b> is a list of <b>statements</b> to be executed by a computer.</p>

<p id="demo"></p>

<script>
var x, y, z;  // Declare 3 variables
x = 5;    // Assign the value 5 to x
y = 6;    // Assign the value 6 to y
z = x + y;  // Assign the sum of x and y to z

document.getElementById("demo").innerHTML =
"The value of z is " + z + ".";
</script>

</body>
</html>
Comment

javascript

coding platform codekata
Comment

javascript

function LogIn(){
loggedin=false;
username="";
password="";
username=prompt("UserName:","");
//username=username.toLowerCase();
password=prompt("PassWord:","");
//password=password.toLowerCase();

if (username=="User-1" && password=="PassWord-1") { 
loggedin=true;
window.location="https://site-1.com";
}

if (username=="User-2" && password=="PassWord-2") {
loggedin=true;
window.location="https://site-2.com";
}

//if (loggedin==false) {
if (loggedin===false) {
alert("OOPS!");
}
}
Comment

javascript

<!DOCTYPE html>
<html>
    <head>
        <title>HTML file</title>
        <script src="script.js" type="text/javascript"></script>
     </head>
    <body>
        <button onclick="greet()">click here</button>
     </body>
</html>
Comment

javascript

/*test/*
Comment

java script

<script type="text/javascript">
    for (let i = 0; i < 10; i++)
    {
         document.write("Hello World!<br>);
    }
</script>
Comment

javascript

{"copyright":"Ian Griffin","date":"2022-10-21","explanation":"Looking north from southern New Zealand, the Andromeda Galaxy never gets more than about five degrees above the horizon. As spring comes to the southern hemisphere, in late September Andromeda is highest in the sky around midnight though. In a single 30 second exposure this telephoto image tracked the stars to capture the closest large spiral galaxy from Mount John Observatory as it climbed just over the rugged peaks of the south island's Southern Alps. In the foreground, stars are reflected in the still waters of Lake Alexandrina. Also known as M31, the Andromeda Galaxy is one of the brightest objects in the Messier catalog, usually visible to the unaided eye as a small, faint, fuzzy patch. But this clear, dark sky and long exposure reveal the galaxy's greater extent in planet Earth's night, spanning nearly 6 full moons.","hdurl":"https://apod.nasa.gov/apod/image/2210/andromeda-over-alps.jpg","media_type":"image","service_version":"v1","title":"Andromeda in Southern Skies","url":"https://apod.nasa.gov/apod/image/2210/andromeda-over-alps1100.jpg"}
Comment

javascript

const = reqire{69}
Comment

javascript

$('[data-toggle="popover"]').popover({ trigger: "manual" , html: true, animation:false})
    .on("mouseenter", function () {
        var _this = this;
        $(this).popover("show");
        $(".popover").on("mouseleave", function () {
            $(_this).popover('hide');
        });
    }).on("mouseleave", function () {
        var _this = this;
        setTimeout(function () {
            if (!$(".popover:hover").length) {
                $(_this).popover("hide");
            }
        }, 300);
});
Comment

javascript

Bumps [dns-packet](https://github.com/mafintosh/dns-packet) from 1.3.1 to 1.3.4.
- [Release notes](https://github.com/mafintosh/dns-packet/releases)
- [Changelog](https://github.com/mafintosh/dns-packet/blob/master/CHANGELOG.md)
- [Commits](mafintosh/dns-packet@v1.3.1...v1.3.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Comment

javascritp

import java.util.Scanner;

public class practice8 {
    public static void main(String[] args) {
        int num1 = (int) (Math.random()*100);
        int num2 = (int) (Math.random()*100);
        Scanner s = new Scanner(System.in);
        System.out.print("what is " +num1+ " -"+num2 + " ? ");
        int answer = s.nextInt();
        int counter = 0;
        boolean anw = num1-num2==answer;
        if (anw) {
            System.out.println("correct");
            counter++;
        } else {
            System.out.printf("incorrect! the answer is %d ",num1-num2);
            
        }
        do {
            if (!anw) {
                break;
                
            }
         num1 = (int) (Math.random()*100);
         num2 = (int) (Math.random()*100);
        System.out.println("what is " +num1+ " -"+num2 + " ? ");
         answer = s.nextInt();
         anw= num1-num2==answer;
         if (anw) {
            System.out.println("correct");
            counter++;
         } else {
            System.out.printf("incorrect! the answer is %d ",num1-num2);
            
         }   
        } while (anw);
        System.out.println();
        System.out.println("you had " + counter + " guess! ");
    }
    
}
Comment

javascript

JavaScript is a scripting language that helps you create interactive web pages
Comment

javascript

bro thats kinda cringe that nobody looked at this....
Comment

PREVIOUS NEXT
Code Example
Javascript :: ngif react 
Javascript :: $[name] in jquery 
Javascript :: js destructuring 
Javascript :: re init data vue js 
Javascript :: math module js 
Javascript :: native module rnc_asyncsqlitedbstorage tried to override asyncstorage module 
Javascript :: class component in react 
Javascript :: get all a tags javascript 
Javascript :: how to add eventlister to multiple variable 
Javascript :: puppeteer set up code 
Javascript :: bubbling and capturing in javascript 
Javascript :: store object in input value 
Javascript :: react select options 
Javascript :: axios cors http localhost forbidden 
Javascript :: web scrape example js 
Javascript :: close jquery 
Javascript :: joining array of string 
Javascript :: delete method 
Javascript :: save item in array javascript 
Javascript :: javascript addeventlistener click only works once 
Javascript :: hide show object in react 
Javascript :: boolean javascript 
Javascript :: message.channel.name.includes 
Javascript :: javascript save as pdf 
Javascript :: react form validation 
Javascript :: react native radio buttons 
Javascript :: mobile detect js 
Javascript :: JavaScript Destructuring - From ES6 
Javascript :: react native firebase login with facebook 
Javascript :: how to target two id using jquery 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =