---
source: kcl/src/simulation_tests.rs
description: Result of parsing array_elem_pop.kcl
---
{
  "Ok": {
    "body": [
      {
        "declaration": {
          "end": 15,
          "id": {
            "end": 3,
            "name": "arr",
            "start": 0,
            "type": "Identifier"
          },
          "init": {
            "elements": [
              {
                "end": 8,
                "raw": "1",
                "start": 7,
                "type": "Literal",
                "type": "Literal",
                "value": {
                  "value": 1.0,
                  "suffix": "None"
                }
              },
              {
                "end": 11,
                "raw": "2",
                "start": 10,
                "type": "Literal",
                "type": "Literal",
                "value": {
                  "value": 2.0,
                  "suffix": "None"
                }
              },
              {
                "end": 14,
                "raw": "3",
                "start": 13,
                "type": "Literal",
                "type": "Literal",
                "value": {
                  "value": 3.0,
                  "suffix": "None"
                }
              }
            ],
            "end": 15,
            "start": 6,
            "type": "ArrayExpression",
            "type": "ArrayExpression"
          },
          "start": 0,
          "type": "VariableDeclarator"
        },
        "end": 15,
        "kind": "const",
        "start": 0,
        "type": "VariableDeclaration",
        "type": "VariableDeclaration"
      },
      {
        "declaration": {
          "end": 35,
          "id": {
            "end": 24,
            "name": "new_arr1",
            "start": 16,
            "type": "Identifier"
          },
          "init": {
            "arguments": [
              {
                "end": 34,
                "name": "arr",
                "start": 31,
                "type": "Identifier",
                "type": "Identifier"
              }
            ],
            "callee": {
              "end": 30,
              "name": "pop",
              "start": 27,
              "type": "Identifier"
            },
            "end": 35,
            "start": 27,
            "type": "CallExpression",
            "type": "CallExpression"
          },
          "start": 16,
          "type": "VariableDeclarator"
        },
        "end": 35,
        "kind": "const",
        "start": 16,
        "type": "VariableDeclaration",
        "type": "VariableDeclaration"
      },
      {
        "declaration": {
          "end": 60,
          "id": {
            "end": 44,
            "name": "new_arr2",
            "start": 36,
            "type": "Identifier"
          },
          "init": {
            "arguments": [
              {
                "end": 59,
                "name": "new_arr1",
                "start": 51,
                "type": "Identifier",
                "type": "Identifier"
              }
            ],
            "callee": {
              "end": 50,
              "name": "pop",
              "start": 47,
              "type": "Identifier"
            },
            "end": 60,
            "start": 47,
            "type": "CallExpression",
            "type": "CallExpression"
          },
          "start": 36,
          "type": "VariableDeclarator"
        },
        "end": 60,
        "kind": "const",
        "start": 36,
        "type": "VariableDeclaration",
        "type": "VariableDeclaration"
      },
      {
        "declaration": {
          "end": 85,
          "id": {
            "end": 69,
            "name": "new_arr3",
            "start": 61,
            "type": "Identifier"
          },
          "init": {
            "arguments": [
              {
                "end": 84,
                "name": "new_arr2",
                "start": 76,
                "type": "Identifier",
                "type": "Identifier"
              }
            ],
            "callee": {
              "end": 75,
              "name": "pop",
              "start": 72,
              "type": "Identifier"
            },
            "end": 85,
            "start": 72,
            "type": "CallExpression",
            "type": "CallExpression"
          },
          "start": 61,
          "type": "VariableDeclarator"
        },
        "end": 85,
        "kind": "const",
        "start": 61,
        "type": "VariableDeclaration",
        "type": "VariableDeclaration"
      },
      {
        "end": 159,
        "expression": {
          "arguments": [
            {
              "computed": false,
              "end": 109,
              "object": {
                "end": 106,
                "name": "new_arr1",
                "start": 98,
                "type": "Identifier",
                "type": "Identifier"
              },
              "property": {
                "end": 108,
                "raw": "0",
                "start": 107,
                "type": "Literal",
                "type": "Literal",
                "value": {
                  "value": 0.0,
                  "suffix": "None"
                }
              },
              "start": 98,
              "type": "MemberExpression",
              "type": "MemberExpression"
            },
            {
              "end": 112,
              "raw": "1",
              "start": 111,
              "type": "Literal",
              "type": "Literal",
              "value": {
                "value": 1.0,
                "suffix": "None"
              }
            },
            {
              "end": 121,
              "raw": "0.00001",
              "start": 114,
              "type": "Literal",
              "type": "Literal",
              "value": {
                "value": 0.00001,
                "suffix": "None"
              }
            },
            {
              "end": 158,
              "raw": "\"element 0 should not have changed\"",
              "start": 123,
              "type": "Literal",
              "type": "Literal",
              "value": "element 0 should not have changed"
            }
          ],
          "callee": {
            "end": 97,
            "name": "assertEqual",
            "start": 86,
            "type": "Identifier"
          },
          "end": 159,
          "start": 86,
          "type": "CallExpression",
          "type": "CallExpression"
        },
        "start": 86,
        "type": "ExpressionStatement",
        "type": "ExpressionStatement"
      },
      {
        "end": 233,
        "expression": {
          "arguments": [
            {
              "computed": false,
              "end": 183,
              "object": {
                "end": 180,
                "name": "new_arr1",
                "start": 172,
                "type": "Identifier",
                "type": "Identifier"
              },
              "property": {
                "end": 182,
                "raw": "1",
                "start": 181,
                "type": "Literal",
                "type": "Literal",
                "value": {
                  "value": 1.0,
                  "suffix": "None"
                }
              },
              "start": 172,
              "type": "MemberExpression",
              "type": "MemberExpression"
            },
            {
              "end": 186,
              "raw": "2",
              "start": 185,
              "type": "Literal",
              "type": "Literal",
              "value": {
                "value": 2.0,
                "suffix": "None"
              }
            },
            {
              "end": 195,
              "raw": "0.00001",
              "start": 188,
              "type": "Literal",
              "type": "Literal",
              "value": {
                "value": 0.00001,
                "suffix": "None"
              }
            },
            {
              "end": 232,
              "raw": "\"element 1 should not have changed\"",
              "start": 197,
              "type": "Literal",
              "type": "Literal",
              "value": "element 1 should not have changed"
            }
          ],
          "callee": {
            "end": 171,
            "name": "assertEqual",
            "start": 160,
            "type": "Identifier"
          },
          "end": 233,
          "start": 160,
          "type": "CallExpression",
          "type": "CallExpression"
        },
        "start": 160,
        "type": "ExpressionStatement",
        "type": "ExpressionStatement"
      },
      {
        "end": 307,
        "expression": {
          "arguments": [
            {
              "computed": false,
              "end": 257,
              "object": {
                "end": 254,
                "name": "new_arr2",
                "start": 246,
                "type": "Identifier",
                "type": "Identifier"
              },
              "property": {
                "end": 256,
                "raw": "0",
                "start": 255,
                "type": "Literal",
                "type": "Literal",
                "value": {
                  "value": 0.0,
                  "suffix": "None"
                }
              },
              "start": 246,
              "type": "MemberExpression",
              "type": "MemberExpression"
            },
            {
              "end": 260,
              "raw": "1",
              "start": 259,
              "type": "Literal",
              "type": "Literal",
              "value": {
                "value": 1.0,
                "suffix": "None"
              }
            },
            {
              "end": 269,
              "raw": "0.00001",
              "start": 262,
              "type": "Literal",
              "type": "Literal",
              "value": {
                "value": 0.00001,
                "suffix": "None"
              }
            },
            {
              "end": 306,
              "raw": "\"element 0 should not have changed\"",
              "start": 271,
              "type": "Literal",
              "type": "Literal",
              "value": "element 0 should not have changed"
            }
          ],
          "callee": {
            "end": 245,
            "name": "assertEqual",
            "start": 234,
            "type": "Identifier"
          },
          "end": 307,
          "start": 234,
          "type": "CallExpression",
          "type": "CallExpression"
        },
        "start": 234,
        "type": "ExpressionStatement",
        "type": "ExpressionStatement"
      }
    ],
    "end": 308,
    "start": 0
  }
}
