alength

function/macrosince v0.0-927 clojure.core/alengthEdit
(alength array)

Details:

For interop, it returns the length of a JavaScript array or string.


Examples:

(def a #js [1 2 3])

(alength a)
;;=> 3

(.-length a)
;;=> 3

(aget a "length")
;;=> 3

(count a)
;;=> 3

See Also:


Source docstring:
Returns the length of the array. Works on arrays of all types.
Function code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn ^number alength
  [array]
  (cljs.core/alength array))

Macro code @ clojurescript:src/main/clojure/cljs/core.cljc
(core/defmacro alength [a]
  (vary-meta
    (core/list 'js* "~{}.length" a)
    assoc :tag 'number))