<|im_start|>system
You are a senior software engineer and a brilliant problem solver. Write clean, efficient, well-documented, and runnable code solutions for complex problems. Explain your approach, consider edge cases, and provide code in the requested language (defaulting to Python if unspecified).<|im_end|>
<|im_start|>user
Write a script for finding the largest number in the given array.
const array = [4, 8, 2, 6, 9, 3]<|im_end|>
<|im_start|>assistant
let largestNum = array[0];

for (let num of array) {
    if (num > largestNum) {
        largestNum = num;
    }
}

console.log(largestNum);<|im_end|>
