aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qmldom/domdata/reformatter/spreadReformatted.qml
blob: fde8ffd686fe0ba6231f8f89874dad54d5ef23ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import QtQuick 2.15

Item {
    function foo() {
        iterableObj = [1, 2];
        obj = {
            a: 42
        };
        let x = (console.log("bla\n"), 3);
        myFunction(...iterableObj); // pass all elements of iterableObj as arguments to function myFunction
        let arr = [...iterableObj, '4', 'five', 6]; // combine two arrays by inserting all elements from iterableObj
        //let objClone = { ...obj }; // pass all key:value pairs from an object (ES2018)
        myFunction(-1, ...args, 2, ...[3]);
        console.log(Math.max(...[1, 2, 3, 4]));
    }
    function myFunction() {
    }
}