-
- ANDROID
- ANDROID_TABLET
- CHROME
- CHROME_VERSION
- DOC_MODE
- DOC_MODE_IE10_LT
- DOC_MODE_IE11_LT
- DOC_MODE_IE12_LT
- DOC_MODE_IE8_LT
- DOC_MODE_IE9_LT
- EDGE
- FIREFOX
- IE10_LT
- IE11_LT
- IE7_LT
- IE8_LT
- IE9_LT
- IE_COMPATIBLE
- IE_VERSION
- IPAD
- IPHONE
- LINUX
- MAC
- MOBILE
- MOBILE_IOS
- MOZILLA
- MSIE
- OPERA
- OPERA_MINI
- OS_VERSION
- SAFARI
- SAMSUNG
- SAMSUNG_VERSION
- SMART_PHONE
- TABLET
- TOUCH_DEVICE
- VERSION
- WEBKIT
- WEBKIT_VERSION
- WINDOWS
- WINDOWS_PHONE
- WINDOWS_TABLET
-
- addChild
- addClass
- addEvent
- attr
- children
- clone
- closest
- contentHeight
- contentWidth
- css
- each
- element
- hasClass
- hasEvent
- height
- html
- innerHeight
- innerWidth
- insertSWF
- match
- next
- outerHeight
- outerWidth
- parent
- prev
- prop
- rect
- remove
- removeAllEvent
- removeAttr
- removeChild
- removeClass
- removeEvent
- removeProp
- replaceWith
- scrollLeft
- scrollTop
- selector
- selectorAll
- text
- transition
- trigger
- width
forEach()
Type : public method
Support : 0.6
Return : void
- 배열의 각 항목에 함수를 실행.
- 일부 낮은 버전의 브라우저에서 지원하지 않는 문제 해결.
박복문을 직접쓰는것 보다는 느리다.
Methods
-
forEach( array, callback ) : voidver 0.6~
-
array : Array대상 배열
-
callback : Functionfunction callback(item:*, index:int, array:Array):Boolean;
-
Example
var ary = [ {name: 'Tajan', age: 29}, {name: 'Cheeta', age: 12}, {name: 'Jane', age: 45} ];
var result = 0;
$B.array.forEach( ary, function ( item, index, array ) {
result += item.age;
});
console.log( result );// 86