Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Pure Function

const array = [1,2,3]
function addElementToArray(a,element){
return [...a, element]
}
//invoce function
addElementToArray(array,4)
//[1,2,3,4]
Source by # #
 
PREVIOUS NEXT
Tagged: #Pure #Function
ADD COMMENT
Topic
Name
3+8 =