Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Erhan Yaşar erhanyasar

🏠
Working from home
View GitHub Profile
View findMaxNumber
const solution = (numbers) => {
let maxNumber = 0;
for (let i=0; i<numbers.length; i++){
if (numbers.length < 1)
return maxNumber;
if (numbers[i] > maxNumber)
maxNumber = numbers[i];
}
return maxNumber;
View Converting Object to an Array
const object = {
'1': 30,
'2': 58
};
function objectToArrConverter (obj) {
if (Object.entries(obj).length === 0)
return [];
else {
let arr = Object.entries(obj);
@erhanyasar
erhanyasar / findMissing
Last active Jun 4, 2020
Some Quiz Questions Solved
View findMissing
let A = [4,12,9,5,6,1],
B = [4,9,12,6];
function findMissing(A, B){
let missingElements = [];
for (var i=0; i<A.length; i++){
for (var j=0; j<B.length; j++){
if (A[i] == B[j])
break;
@erhanyasar
erhanyasar / barcodeReader.js
Last active Jun 15, 2020
Some of the sample codes I've developed
View barcodeReader.js
function tryAppStore() {
setTimeout(function() {
window.location = "https://appsto.re/tr/6XPCz.i";
}, 25);
window.location="Barcode://scan/";
}
function tryGoogleStore() {
setTimeout(function() {
window.location = "https://play.google.com/store/apps/details?id=com.google.zxing.client.android&hl=en";
}, 25);
View formControl.js
$(document).ready(function() {
let f1err = 0,
f2err = 0,
f3err = 0,
date = new Date();
$("#sendBTN").click(function() {
if (($("#username").val() == "") || ($("#phone").val() == "")) {
f1err = 1;
if ($("#username").val() == "") {