---
title: "The Properties Class"
url: https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-class
language: js
docs_index: https://docs.zeroc.com/llms.txt
---

> For an index of every page, see [llms.txt](https://docs.zeroc.com/llms.txt).

# The Properties Class

Programming language: JavaScript. Other languages: [C++](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-class/cpp.md), [C#](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-class/csharp.md), [Java](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-class/java.md), [MATLAB](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-class/matlab.md), [PHP](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-class/php.md), [Python](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-class/python.md), [Ruby](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-class/ruby.md), [Swift](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-class/swift.md).

A [Properties](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html) object, or *property set*, is a collection of properties. Each communicator has a property set, which its [`getProperties`](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Communicator.html#getproperties) method returns. You can also create a property set yourself, for example to configure a new communicator.

## Reading and Setting a Property

[`getProperty`](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#getproperty), [`getPropertyAsInt`](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#getpropertyasint), and [`getPropertyAsList`](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#getpropertyaslist) read a property as a string, an integer, or a list of strings. Their `WithDefault` variants, [`getPropertyWithDefault`](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#getpropertywithdefault), [`getPropertyAsIntWithDefault`](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#getpropertyasintwithdefault), and [`getPropertyAsListWithDefault`](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#getpropertyaslistwithdefault), return the default you give for a property that is not set.

[`setProperty`](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#setproperty) sets a property, and applies the [property validation](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-overview/js.md#property-validation) rules.

## Reading an Ice Property

An *Ice property* is a property that Ice defines, such as `Ice.Warn.Dispatch`: its name begins with a [reserved prefix](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-overview/js.md#reserved-prefixes), and the [property reference](https://docs.zeroc.com/ice/3.8/property-reference.md) lists it with its default value. [`getIceProperty`](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#geticeproperty), [`getIcePropertyAsInt`](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#geticepropertyasint), and [`getIcePropertyAsList`](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#geticepropertyaslist) read an Ice property and, unlike the plain `getProperty` methods, return its default value when it is not set. For example, if you never set `Ice.Warn.Dispatch`, `getIcePropertyAsInt("Ice.Warn.Dispatch")` returns its default of `1`, while `getPropertyAsInt("Ice.Warn.Dispatch")` returns `0`.

These three methods accept only the names of Ice properties. Read the other properties, such as the properties of an object adapter or a proxy, with the plain `getProperty` methods, which take any name.

## Reading and Parsing Groups of Properties

[`getPropertiesForPrefix`](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#getpropertiesforprefix) returns the properties whose names begin with a prefix, and marks them as [used](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-overview/js.md#unused-properties). [`parseCommandLineOptions`](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#parsecommandlineoptions) and [`parseIceCommandLineOptions`](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#parseicecommandlineoptions) convert command-line arguments of the form `--name=value` into properties, with the same validation as `setProperty`, and [`getCommandLineOptions`](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#getcommandlineoptions) converts a property set back into such arguments.

[`parse`](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#parse) loads properties from the contents of a [configuration file](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/configuration-file-syntax.md) that you supply as a string.
