Guest User

Untitled

a guest
Nov 16th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width">
  6. <title>JS Bin</title>
  7. </head>
  8. <body>
  9.  
  10. <script id="jsbin-javascript">
  11. //-----------------------------------
  12. //Name: Sean Sikorski
  13. //-----------------------------------
  14.  
  15.  
  16. //-----------------------------------
  17. //Excercise: Property Path Evaluation
  18. //-----------------------------------
  19. function propertyValueAt(object, index){
  20. switch(index.length){
  21. case 1:
  22. return object[index[0]];
  23. break;
  24. case 2:
  25. return object[index[0]][index[1]];
  26. break;
  27. default:
  28. console.log("ERROR: index given is in incorrect format");
  29. }
  30. }
  31.  
  32. //-----------------------------------
  33. //Excercise: Sum Nested Arrays
  34. //-----------------------------------
  35. function sumNested
  36.  
  37.  
  38. function main(){
  39.  
  40.  
  41. }
  42.  
  43. main();
  44. </script>
  45.  
  46.  
  47.  
  48. <script id="jsbin-source-javascript" type="text/javascript">//-----------------------------------
  49. //Name: Sean Sikorski
  50. //-----------------------------------
  51.  
  52.  
  53. //-----------------------------------
  54. //Excercise: Property Path Evaluation
  55. //-----------------------------------
  56. function propertyValueAt(object, index){
  57. switch(index.length){
  58. case 1:
  59. return object[index[0]];
  60. break;
  61. case 2:
  62. return object[index[0]][index[1]];
  63. break;
  64. default:
  65. console.log("ERROR: index given is in incorrect format");
  66. }
  67. }
  68.  
  69. //-----------------------------------
  70. //Excercise: Sum Nested Arrays
  71. //-----------------------------------
  72. function sumNested
  73.  
  74.  
  75. function main(){
  76.  
  77.  
  78. }
  79.  
  80. main();</script></body>
  81. </html>
Add Comment
Please, Sign In to add comment