Define first option in a dropdown

Hi,

I’m using the following code, in the onReady function to try and add ‘ENGLISH’ as the first option in a dropdown list of languages but it doesn’t appear to be working?

let languageOptions = $w("#ddPrimaryLanguage").options;
    languageOptions.unshift({
        value: "ENGLISH",
        label: "ENGLISH"
    });
    $w("#ddPrimaryLanguage").options = languageOptions;

Any suggestions?
Thanks,
Rachel

What are you trying to use this for?

if you are just using a dropdown list, then you can do it yourself already my adding and moving the selections yourself.
https://support.wix.com/en/article/adding-and-setting-up-a-dropdown-list
https://support.wix.com/en/article/managing-your-dropdown-list-choices
Wix Dropdown API reference: https://www.wix.com/corvid/reference/$w.Dropdown.html

If you are using it through Wix Multilingual, then you can also do it yourself already too.
https://support.wix.com/en/wix-multilingual/wix-multilingual-basics
https://support.wix.com/en/article/reordering-languages-in-your-language-menu
Wix Multilingual API reference: https://www.wix.com/corvid/reference/wix-window.multilingual.html

I’m using it in a form where I have a dropdown for users to select their language. These are being pulled from a dataset but I would like ‘ENGLISH’ to be the first option in the dropdown.