google+javascriptbanktwitter@js_bankfacebook@jsbankrss@jsbank






Populaires int Dans ce libre de HTML JavaScript tutoriel, je vais


�tiquette: fonctions JavaScript, Built-in, fonction en JavaScript, Fonction tableau JavaScript, Fonctions Date Javascript, Fonctions math

G�n�rez vos vid�os d'entreprise par l'IA avec la voix ou simplement du texte



Votre premi�re application vid�o AI GRATUITE ! Automatisez votre premi�re vid�o AI. Cr�ez votre vid�o professionnelle en 5 minutes gr�ce � l'IA. Aucun �quipement ni comp�tence en montage vid�o requis. Production vid�o sans effort pour les sp�cialistes du marketing de contenu.
Application vid�o AI ILLIMIT�E gratuite � port�e de main

In this article, I'll list all of the built in functions available to you with Javascript. While not everything will be covered, I will cover every function that is used on a regular basis. I'm still deciding whether I'll cover Javascript Graphics or AJAX next. Leave comments below to help me understand. On to the functions.

Javascript Array Functions

In previous articles I described how to create Arrays, but if you forgot here is how you create arrays:

  • var a = new array() // Creates an empty array
  • var b = new array(8) // Creates an array with 8 element cells
  • var c = [1, 2, "turtle", "number", true]; // Creates an array with a bunch of random values

Javascript Array Properties and Functions

  • b.length // A property that would return the value of 8, because of the array declaration above
  • c.concat(3,4) // The array c now has the values 1, 2,  "turtle", "number", true, 3, 4
  • c.join(": ") // Returns a string with each element separated by a colon and a space. 1: 2: number: true
  • c.slice(0, 2) // Returns an array which contains all elements between the first value you pass to the second value. In this example you would be returned [1, 2, number]
  • c.sort() // Returns the array elements in alphabetical order. This example returns [1, 2, number, true, turtle]
  • c.toString() // Converts the array into a string and then returns the string.

Javascript Date Functions

There are numerous date functions. I'll cover the most commonly used here.

  • a = new Date(); // Creates a new date object and assigns the current time to it
  • document.write(a.getTime()); : Returns a millisecond representation of a date. ex. 1270487133410
  • document.write(a.getDay()); : Returns the day of the week
  • document.write(a.getFullYear()); : Returns the year of the date
  • document.write(a.getHours()); : Returns the hours of the set date
  • document.write(a.getMinutes()); : Returns the minutes of the set date
  • a.setTime(); : Creates a millisecond representation of a date. ex. 1270487133410
  • a.setDay(); : Sets the day of the week
  • a.setFullYear(); : Sets the year of the date
  • a.setHours(); : Sets the hours of the set date
  • a.setMinutes(); : Sets the minutes of the set date

Javascript Math Functions

Here are a few of the most commonly used Javascript Math Functions

  • isNaN(variableToTest) : Returns true if the variable is a number and false otherwise
  • Math.abs(variableToTest) : Performs an absolute value calculation
  • Math.ceil(variableToTest) : Rounds a number up
  • Math.floor(variableToTest) : Rounds a number down
  • Math.max(x, y) : Returns the larger of the two variables it is passed
  • Math.min(x, y) : Returns the smaller of the two variables it is passed
  • Math.random(): Returns a random number
  • parseFloat(string) : Converts a string into a float number
  • parseInt(string) : Converts a string into an int number

Javascript String Functions

Here are a few of the most used string functions.

  • stringVariable.length : Returns the number of characters in a string
  • stringVariable.charAt(x) : Returns the character at the position sent to this function
  • stringVariable.concat(x1, x2) : Adds one or more values to the end of the string
  • stringVariable.indexOf(wordYourLookingFor, whereToStartSearch) : Searches the string for a chosen word or character
  • stringVariable.match(regexp) : Look for a specific regular expression in a string. See my Javascript Regular Expression tutorial if you don't know what they are.
  • stringVariable.replace(regexp, replacementText) : Search for a regular expression match and then replace the match with the replacement text given
  • stringVariable.slice(startPoint, endPoint) : Extracts a string from the beginning point to the ending point given
  • stringVariable.split(delimiter, maxLength) : Breaks a string into a series of cells, by separating the words by the chosen delimiter. ex. "1,2,3,4″.split(",") would return ["1","2","3","4"]. You have the option of defining a maximum number of elements in the array that is created.

Javascript Document Functions

  • document.getElementsByName(idName) : Provides you with access to a node on the web page by passing it the id Name.
  • document.write() : Appends text or variable values to the web page
  • document.writeln() : Appends text or variable values to the web page, followed by a newline

Javascript Event Handlers

  • onclick : Performs an action when the user clicks on a node in a document
  • ondblclick : Performs an action when the user double clicks on a node in a document
  • onkeydown : Performs an action when the user presses a key
  • onkeypress : Performs an action when the user presses and releases a key
  • onkeyup : Performs an action when the user releases a key
  • onmousedown : Performs an action when the user presses the mouse button
  • onmousemove : Performs an action when the user moves the mouse
  • onmouseout : Performs an action when the user moves the mouse off of an element
  • onmouseover : Performs an action when the user moves their mouse over an element
  • onmouseup : Performs an action when the user releases a mouse button

Javascript Node Functions

  • node.appendChild(nodeName) : Inserts a new node after the node specified.
  • node.insertBefore(nodeName) : Insert a new node in front of the node you specified.
  • node.removeChild(nodeName) : Remove the child node of the node you specified
  • node.replaceChild(nodeName) : Replace a child node with the new one you are specifying

That is basically all of the commonly used prebuilt functions available to you in Javascript. You also basically also know just about all there is to know about Javascript as well. I'm going to cover AJAX, which allows you to communicate with the web server without reloading the web page. Also, look forward to a Javascript Graphics Tutorial.

As always, leave your questions or comments below.

Till next time...

AIVideo-App.com
Générez vos vidéos d'entreprise par l'IA avec la voix ou simplement du texte

chatGPTaz.com
Parlez à ChatGPT dans votre langue maternelle

AppAIVidéo
Votre première application vidéo AI GRATUITE

Deepfake Video
Deepfake AI Video Maker

Deepfake
Deepfake AI Video Maker

AI Deep Fake
Deepfake AI Video Maker

AIvidio
AI Video Mobile Solutions

AIvideos
AI Video Platform & Solutions

AIvedio
AI Video App Maker

Artificial General Intelligence
Ai and higher level Artificial General Intelligence (AGI)

Artificial General Intelligence
Ai and higher level Artificial General Intelligence (AGI)

Faceswap AI en ligne
Échangez des visages, des vidéos, des photos et des GIF instantanément avec de puissants outils d'IA - Faceswap AI Online GRATUIT

Faceswap AI en ligne
Échangez des visages, des vidéos, des photos et des GIF instantanément avec de puissants outils d'IA - Faceswap AI Online GRATUIT

Faceswap AI en ligne
Échangez des visages, des vidéos, des photos et des GIF instantanément avec de puissants outils d'IA - Faceswap AI Online GRATUIT

Powerful AI Presentation PPT Maker for FREE
Build an impressive presentation with our free online AI presentation app

Your next top AI Assistant
Claude AI, developed by Anthropic

Your next top AI Assistant
Claude AI, developed by Anthropic

Temu gratuit 500 $ pour les nouveaux utilisateurs
Claim Free Temu $500 Credit via Affiliate & Influencer Program

Crédits publicitaires TikTok gratuits
Maîtrisez les publicités TikTok pour le marketing de votre entreprise

Dall-E-OpenAI.com
Générez automatiquement des images créatives avec l'IA

chatGPT4.win
Parlez à ChatGPT dans votre langue maternelle

Premier produit d'intelligence artificielle d'Elon Musk - Grok/UN.com
Parlez au chatbot Grok AI dans votre langue

Outily.win
Centre d'outils ouvert et gratuit, utilisable par tous et pour tous, avec des centaines d'outils

GateIO.gomymobi.com
Airdrops gratuits à réclamer et à partager jusqu'à 150 000 $ par projet

iPhoneKer.com
Économisez jusqu'à 630 $ à l'achat d'un nouvel iPhone 16

Acheter le robot Tesla Optimus
Commandez votre robot Tesla Bot : Optimus Gen 2 dès aujourd'hui pour moins de 20 000 $

JavaScript par jour


Google Safe Browsing McAfee SiteAdvisor Norton SafeWeb Dr.Web