Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

randome words api

// GetRandom Words from API and push to Array
async function getRandomWord() {

  const res = await fetch('https://random-words-api.vercel.app/word');

  const data = await res.json();
  return data[Object.keys(data)[0]].word.toLowerCase();

}

getRandomWord();

// Add Word to DOM
async function addWordToDOM() {
  randomWord = await getRandomWord();
  word.innerHTML = randomWord;
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript pad with leading zeros 
Javascript :: regx get only domain name from url 
Javascript :: node string to json 
Javascript :: trigger click jquery 
Javascript :: javascript get domain name from string 
Javascript :: javascript round to 2 decimal places 
Javascript :: js random number between 1 and 10 
Javascript :: jquery scroll to id 
Javascript :: Scrool to the bottom of a div 
Javascript :: javascript change class of item 
Javascript :: is array equal javascript 
Javascript :: javascript check if undefined or null 
Javascript :: error: bundling failed: Error: Unable to resolve module react-native-community/toolbar-android 
Javascript :: unique array javascript es6 Map 
Javascript :: javascript object toarray 
Javascript :: sqlite3 multithreading nodejs 
Javascript :: scroll to top jquery 
Javascript :: normalize css cdn 
Javascript :: jquery change text of div 
Javascript :: styled components error in nextjs 
Javascript :: make the log do a jump in line js 
Javascript :: check if element has childs jquery 
Javascript :: javascript loop through array 
Javascript :: js foreach determine if last 
Javascript :: nuxt 18 mountend route push 
Javascript :: protractor move mouse and click 
Javascript :: fetch bearer token 
Javascript :: for key value in object javascript 
Javascript :: how to check if 2 sprites are touching js 
Javascript :: increase-memory-limit not working node 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =