Search
ObservableCollection.clear Method
See Also
Collapse All Expand All Language Filter: All Language Filter: Multiple Language Filter: None Language Filter: C# Language Filter: Visual Basic Language Filter: Java Language Filter: JavaScript Language Filter: C++ Language Filter: XAML
C#
Visual Basic
Java
JavaScript
C++
XAML
Introduction
General Information
What's New In This Release
Version History
Getting Started
Code Completion With VSDoc IntelliSense
Programming Interface Overview
Tutorials
Reference
MindFusion.Common
MindFusion.Common.Collections
IEnumerable Class
List Class
ObservableCollection Class
ObservableCollection Members
ObservableCollection Constructor
ObservableCollection Methods
add Method
clear Method
insert Method
remove Method
removeAt Method
removeRange Method
ObservableCollection Events
MindFusion.Controls
MindFusion.Scheduling
Licensing
Online Resources
Technical Support
MindFusion Products

Clears the collection.

Namespace: MindFusion.Common.Collections
Assembly: ObservableCollection.js

## Syntax

JavaScript Copy Code
function clear ()

## Example

The following code checks if the count of items in the collection is more than 100 and if so, clears the collection:

JavaScript Copy Code
var products = new ObservableCollection([product1, product2, ...]); ..... ..... if(products.count() > 100) products.clear();

## See Also

ObservableCollection Members
ObservableCollection Class
MindFusion.Common.Collections Namespace