08 - Mutated Recursive Function Parameters
by steen_hansen
HTML
<!DOCTYPE html><meta charset="utf-8" />
<title>08 Mutated Recursive Function Parameters</title>
<div id='js-div' style="width:60%">
<a href='https://github.com/steenhansen/type-czech' target="_blank" class='git-hub'>GitHub Package</a>
<div id='js-code'>the javascript</div>
</div>
<div id="the-explanation" style="width:40%">
<div class='an-explantion'>08 - Mutated Recursive Function Parameters</div>
<div id='explanation-text'>
<br>
Mutations of array and object parameters in recursive functions can also be caught.
In the example to the left, a change to the parameter 'growing_array' inside the
function recurseArr() is flagged
with the first difference shown in the console; a 3 changed to 'THREE'.
<br><br>
Note the new line in '\n1,2,THREE' is for the console where it looks correct.
<br><br>
Warning, using these functions with large objects recursively can get very memory intensive
as all values are saved to JSON format. Specifically the window object.
<br><br>
</div>
<div id="console-log" >
<div class='a-title'>Console Output</div>
<div id='log-text'></div>
<br>
</div>
<br><br>
<!-- ----------------TYPE 1-------------------------- -->
<script src="https://cdn.jsdelivr.net/gh/steenhansen/type-czech@latest/web-resources/consolelog.js"></script>
<script src="https://cdn.jsdelivr.net/gh/steenhansen/type-czech@latest/web-resources/TypeCzech.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/steenhansen/type-czech@latest/web-resources/type-czech.css">
<!-- ---------------TYPE 1--------------------------- -->
<div id='js-fiddles'>
<a title="Example-Contents" href="https://jsfiddle.net/steen_hansen/1Lshcept/?Example-Contents" target="_blank">Contents</a>
<a title="00-Readme-Example" href="https://jsfiddle.net/steen_hansen/0xtpLwsc/?00-Readme-Example" target="_blank">00</a>
<a title="01-What-is-TypeCzech"...