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: Jarek Crowder
- //------------------------------------------
- //------------------------------------------
- // Exercise: Property Path Evaluation
- //------------------------------------------
- function propertyValueAt(){
- }
- // //------------------------------------------
- // // Exercise: Sum Nested Arrays
- // //------------------------------------------
- var data = [[1, 0], [2013,1,29, 1], [2013,2,5, 21]];
- function sumNested(data){
- var total = 0;
- for(var i = 0, len = data.length; i < len; i++) {
- total += data[i][1];
- }
- return total
- }
- // /*------------------------------------------
- // // Exercise: Word Count
- // -------------------------------------------*/
- var sentence ='How many words in this sentence?';
- function wordCount(sentence){
- return sentence.split(' ').length
- }
- /*console.log(sentence.split(' ').length)
- console.log(wordCount(sentence))*/
- // /*------------------------------------------
- // // Exercise: Anagram Tester
- // -------------------------------------------*/
- function areTheseAnagrams(a,b){
- //a = b;
- //b = a;
- var lose = (a +' and '+ b + ' are not anagrams!');
- var win = (a +' and '+ b + ' are anagrams!');
- if (a == b){
- return win
- } // returns true
- else{
- return lose
- } // returns false
- }
- /* I couldn't figure out how to sort a string based on its characters in JS but I believe the rest of the
- function would work IF I had figured out how to sort them. */
- // /*------------------------------------------
- // // Exercise: Analyze Prices
- // -------------------------------------------*/
- // function analyzePrices(){
- // }
- // /*------------------------------------------
- // // Exercise: Fizz Buzz
- // -------------------------------------------*/
- function fizzBuzz(n){
- if(n <= 0){
- var x='';
- return x
- }else if(n > 0){
- return n
- }
- }
- /*function isWholeNumber(x) {
- if (x % 1 === 0) {
- return True
- } else {
- return False
- }
- }*/
- </script>
- <script id="jsbin-source-javascript" type="text/javascript">//------------------------------------------
- // Name: Jarek Crowder
- //------------------------------------------
- //------------------------------------------
- // Exercise: Property Path Evaluation
- //------------------------------------------
- function propertyValueAt(){
- }
- // //------------------------------------------
- // // Exercise: Sum Nested Arrays
- // //------------------------------------------
- var data = [[1, 0], [2013,1,29, 1], [2013,2,5, 21]];
- function sumNested(data){
- var total = 0;
- for(var i = 0, len = data.length; i < len; i++) {
- total += data[i][1];
- }
- return total
- }
- // /*------------------------------------------
- // // Exercise: Word Count
- // -------------------------------------------*/
- var sentence ='How many words in this sentence?';
- function wordCount(sentence){
- return sentence.split(' ').length
- }
- /*console.log(sentence.split(' ').length)
- console.log(wordCount(sentence))*/
- // /*------------------------------------------
- // // Exercise: Anagram Tester
- // -------------------------------------------*/
- function areTheseAnagrams(a,b){
- //a = b;
- //b = a;
- var lose = (a +' and '+ b + ' are not anagrams!');
- var win = (a +' and '+ b + ' are anagrams!');
- if (a == b){
- return win
- } // returns true
- else{
- return lose
- } // returns false
- }
- /* I couldn't figure out how to sort a string based on its characters in JS but I believe the rest of the
- function would work IF I had figured out how to sort them. */
- // /*------------------------------------------
- // // Exercise: Analyze Prices
- // -------------------------------------------*/
- // function analyzePrices(){
- // }
- // /*------------------------------------------
- // // Exercise: Fizz Buzz
- // -------------------------------------------*/
- function fizzBuzz(n){
- if(n <= 0){
- var x='';
- return x
- }else if(n > 0){
- return n
- }
- }
- /*function isWholeNumber(x) {
- if (x % 1 === 0) {
- return True
- } else {
- return False
- }
- }*/</script></body>
- </html>
Add Comment
Please, Sign In to add comment