Default arguments for qml function gives syntax errors

Viewed 3377

This code works fine in browser hosted JavaScript environment :

    function foo(a=true)
    {
        console.log(a)
    }

But doing the same in qml is giving syntax error.

What might I be doing wrong ?

2 Answers

From Qt 5.12, this code will work fine. See release note.

  • The JavaScript engine now supports ECMAScript 7

Hope this will help people in the future.

Related