KW Online Tools Zone
Knowledge Walls
View All Tools Home
HOW TO USE CALL BY REFERENCE IN JAVASCRIPT FUNCTIONS WITH EXAMPLE
[Javascript editor]
Run
Share Link
Clear
HTML [Ctrl+Enter] - to run
<p><b>How to use call by reference in Javascript functions with Example</b></p>
CSS [Ctrl+Enter] - to run
Javascript [Ctrl+Enter] - to run
function addAdditionalNames(userNames){ userNames.push("Sarathy"); userNames.push("Gopal"); userNames.push("Lakshanya"); } var userNames = new Array(); userNames.push("Raja"); userNames.push("Vijay"); userNames.push("Kumar"); document.write(userNames+"<br />"); addAdditionalNames(userNames); document.write(userNames+"<br />");
OUTPUT
Copyright © 2021 Knowledge walls, All rights reserved
Copyright © 2021 Knowledge walls, All rights reserved