AutoIt+
  • Overview
  • Getting started
  • The language
    • Basic
    • Grammar
      • Expressions
      • Statements
      • Declarations
    • Operators
    • Variables
    • Types & values
      • Null
      • Booleans
      • Numbers
      • Strings
      • Functions
      • Classes
      • Pointers
    • Control flow
      • If statement
      • For loop
      • While loop
      • Break & continue
      • Error handling
    • Collections
      • Array
        • APIs
        • Implementation
      • Map
        • APIs
        • Implementation
    • Modules
    • Exceptions
  • Built-in modules
    • C
      • APIs
      • Constants
    • Math
      • APIs
      • Constants
    • Task
      • Types
      • APIs
    • Global
  • The aup
    • Compiler
    • Runtime
    • Options
Powered by GitBook
On this page
  • Properties
  • .length
  • .keys
  • Methods
  • .has(key)
  • .get(key)
  • .set(key, value)

Was this helpful?

  1. The language
  2. Collections
  3. Map

APIs

Properties

.length

Getter

Return number of element in map

var trans = { en: 'Hello', vi: 'Xin chào' }
puts 'We have ' + trans.length + 'translations'

.keys

Getter

Return array of keys in map

var tup = { a: 4, b: 5 }
puts tup.keys    // [a, b]

Methods

.has(key)

Check if a key exists in map

Parameters (1)

key : A key for checking

Return value

This method returns true if the key has existed, otherwise is false.

var threeDee = true
var point = { x: 20, y: 50 }

if threeDee && !point.has('z') {
    point['z'] = 100
}

puts point    // { x: 20, y: 50, z: 100 }

.get(key)

.set(key, value)

PreviousMapNextImplementation

Last updated 4 years ago

Was this helpful?