Convert this Python function to JavaScript.
def string_to_num_list(string):
    numbers = []
    for letter in string:
        numbers.append(ord(letter))
    return numbers
function stringToNumList(string) {
    let numbers = [];
    for (let letter of string) {
        numbers.push(letter.charCodeAt(0));
    }
    return numbers;
}