Looping Array

Run Settings
LanguageJavaScript
Language Version
Run Command
const laptop = ['asus', 'lenovo', 'acer', 'hp', 'axio0']; const gpu = ['4070', '4090', '4050', '4080', '4060']; const laptopGpu = (valLap, valGpu) => { valLap.sort() valGpu.sort() let result = [] for (let i = 0; i < valLap.length && i < valGpu.length; i++) { result.push(`{${valLap[i]} dengan gpu ${valGpu[i]}}`) } return result } console.log(laptopGpu(laptop, gpu));
Editor Settings
Theme
Key bindings
Full width
Lines