- What is the output of the following code?
console.log(typeof NaN);
a) "undefined" b) "number" c) "NaN" d) "object"
const fetchData = () => { | |
return new Promise((resolve, reject) => { | |
// Here we are simulating an action that would likely take time, basically it doesn't run immediately | |
// it could be something like long calculations, fetching data from a server, writing data to a file, etc ... | |
setTimeout(() => { | |
const success = true; // this is just to simulate a successful action | |
if (success) { | |
// if we succeed then we mark as resolved | |
resolve('Data fetched successfully!'); |
console.log(typeof NaN);
a) "undefined" b) "number" c) "NaN" d) "object"
[ | |
{ | |
"number": 1, | |
"key": "ibyo-tubona-mwiyi-si", | |
"title": "Ibyo tubona mw'iyi si", | |
"markdown": "1. Ibyo tubona ...Mwiyisi Nubusagusa\nNinyi Buchu bihinduka mukanya gato Neino duhunge umujyinya wuwiteka\n\n**Chorus**\n\nImanda Yanyuma nivuga nituzasezeranaho abapfuye bazazuka tuzarebana twishimye tuzarira amarirayumunezero.\n\n2. ubugome bwikigihe burenze urugero Abantu benshi bigize \n\n**Chorus**\nIsinshya nijuru Rishya Yesu azadutambagiza yerusaremunshya tuza mbikwa amakamba yizahabu.\n\n3. Ababyeyi Bikigihe barahangayitse abana babobigize ibwigomeke Yesu Niwemurezi mwiza utayobya.\n\n**Chorus**\n\nImanda Yanyuma nivuga nituzasezeranaho abapfuye bazazuka tuzarebana twishimye tuzarira amarirayumunezero.(×2)\n\nIsinshya nijuru Rishya dorebose byahumuye Yesu azadutambagiza muri yerusaremunshya tuza mbikwa amakamba yizahabu.(×2}" | |
}, | |
{ | |
"number": 2, | |
"key": "tuzanywe-no-kuvuga", |
import json | |
students = [] | |
def add_student(): | |
print("\nAdd New Student Details:") | |
last_name = input("Last Name: ") | |
first_name = input("First Name: ") | |
id_number = input("ID Number: ") | |
major = input("Major: ") |
@echo off | |
setlocal enabledelayedexpansion | |
:: Prompt for username | |
set /p username=Enter the username for which you want to change the password: | |
:: Prompt for new password | |
set /p newPassword=Enter the new password: | |
:: Change the password |
import json | |
students_data = [] | |
def add_student(): | |
last_name = input("Enter last name: ") | |
first_name = input("Enter first name: ") | |
id_number = input("Enter ID number: ") | |
major = input("Enter major: ") | |
email = input("Enter email: ") |
{ | |
"breakpoints": { | |
"keys": [ | |
"xs", | |
"sm", | |
"md", | |
"lg", | |
"xl" | |
], | |
"values": { |
import { useEffect, useState } from 'react'; | |
/** | |
* Debounce a value to avoid constant calls to the server | |
* @param value it can be a string or a number | |
* @param delay the amount in milliseconds that will be delayed | |
* @returns The give value debounced | |
*/ | |
export default function useDebounceValue<T>(value: T, delay: number): T { | |
const [debouncedValue, setDebouncedValue] = useState<T>(value); |
function removeDuplicates(arr, prop){ | |
return arr.filter((obj, index, self) => { | |
return index === self.findIndex((t) => { | |
return t[prop] === obj[prop] | |
}) | |
}) | |
} |
function onInputChange(file) { | |
// convert image file to base64 string | |
const reader = new FileReader(); | |
reader.addEventListener( | |
'load', | |
() => { | |
setInputImg(reader.result); | |
}, | |
false |