Skip to content

Instantly share code, notes, and snippets.

View bryancodesjs's full-sized avatar

Bryan bryancodesjs

View GitHub Profile
@bryancodesjs
bryancodesjs / XMLHttpRequest.js
Created January 21, 2022 17:45
How to make an XML HttpRequest
//For this gist, I'm using a free, public API that shows information about a user's location based on their IP address
//here's where I store the API key I was provided with
const myKey = 'c00508dc4104c70518fcf49e17216676';
//here's a random IP from the internet
const myIp = '191.101.63.2';
function myRequest(){
//initialize the XMLHttpRequest object
const request = new XMLHttpRequest();
@bryancodesjs
bryancodesjs / find-multiple.js
Last active January 20, 2022 04:28
Count from 1 to 100 and print a message every time a multiple of 3 or 5 is found.
function findMultiples() {
let baseNumer = 0;
for(let i = 0; i<100 ; i++) {
baseNumer ++;
console.log(baseNumer);
if(baseNumer % 3 == 0) {
console.log('multiple of 3 found');
} else {
if (baseNumer % 5 == 0) {
console.log('multiple of 5 found');