Products Downloads


French version


 

Remove one or more attributes from a Hash-type object.

The Hash object passed as a parameter must be an object created by the "createSimpleHash" function.


Parameters

Hash

removeInThisHash

Hash object from which to remove one or more attributes

Mandatory

String
/
Sequence of String

attrToRemove
/
seqAttrToRemove

Name of the attribute to remove.

Sequence of names of attributes to remove.

Mandatory

 


For example

<#assign copiedHash = {"attr1": 1,
	"attr2":true,
	"attr3":false,
	"attr4":4,
	"attr5":"ok",
	"attr6":14.5,
	"attr7":[4, 44] } />
<#assign removeInThisHash = hardisCore.createSimpleHash(copiedHash) />
<#-- Remove one attribute in removeInThisHash -->
<#assign noUse = hardisCore.removeFromSimpleHash(removeInThisHash , "attr1") />
<#-- Remove two attributes in removeInThisHash -->
<#assign noUse = hardisCore.removeFromSimpleHash(removeInThisHash , ["attr2", "attr3"]) />
<#-- Remove all attributes in removeInThisHash -->
<#assign noUse = hardisCore.removeFromSimpleHash(removeInThisHash , removeInThisHash?keys) />