Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width">
- <title>JS Bin</title>
- </head>
- <body>
- <script id="jsbin-javascript">
- //-----------------------------------
- //Name: Sean Sikorski
- //-----------------------------------
- //-----------------------------------
- //Excercise: Property Path Evaluation
- //-----------------------------------
- function propertyValueAt(object, index){
- switch(index.length){
- case 1:
- return object[index[0]];
- break;
- case 2:
- return object[index[0]][index[1]];
- break;
- default:
- console.log("ERROR: index given is in incorrect format");
- }
- }
- //-----------------------------------
- //Excercise: Sum Nested Arrays
- //-----------------------------------
- function sumNested
- function main(){
- }
- main();
- </script>
- <script id="jsbin-source-javascript" type="text/javascript">//-----------------------------------
- //Name: Sean Sikorski
- //-----------------------------------
- //-----------------------------------
- //Excercise: Property Path Evaluation
- //-----------------------------------
- function propertyValueAt(object, index){
- switch(index.length){
- case 1:
- return object[index[0]];
- break;
- case 2:
- return object[index[0]][index[1]];
- break;
- default:
- console.log("ERROR: index given is in incorrect format");
- }
- }
- //-----------------------------------
- //Excercise: Sum Nested Arrays
- //-----------------------------------
- function sumNested
- function main(){
- }
- main();</script></body>
- </html>
Add Comment
Please, Sign In to add comment