Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Created by Lusien.GG on 17-06-16.
- */
- 'use strict'
- function keyValue(input) {
- let collection = []
- for (let i=0; i<input.length-1; i++){
- let tokens = input[i].split(' ')
- let obj = { key: tokens[0],value: tokens[1] }
- collection.push(obj)
- }
- let a = true;
- for ( let obj of collection){
- if (obj.key === input[input.length-1]) {
- console.log(obj.value)
- a = false;
- }
- }
- if(a)
- console.log("None")
- }
- // keyValue(['key value',
- // 'key eulav',
- // 'test tset',
- // 'key'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement