Untitled

mail@pastecode.io avatar
unknown
javascript
2 years ago
613 B
1
Indexable
Never
function inputVerify (target) {
    let input;
    do {
        input = prompt("Please Enter " + target +" :");
        console.log(input)
    } while (input !== null && input !== 'stop')
}   

let get = inputVerify('Username');

const createObj = () => {
    const obj = {}
    let key, val;
    do {
        key = prompt("Key :");

        if (key === 'stop') {break}
        
         val = prompt("Value :")
        
        if (val === 'stop') {break}
        
        obj[key] = val
        
    } while (key !== 'stop' && val !== stop)
    return obj;
}

let test = createObj();