GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ToyProblems/daniel-stuff.js at master · patrickford/ToyProblems

Expand file tree

/

daniel-stuff.js

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
39 lines (36 loc) · 802 Bytes
/

daniel-stuff.js

Copy path

File metadata and controls

39 lines (36 loc) · 802 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
function accum(str) {
result = "";
for (var i=0; i<str.length; i++) {
result += str[i].toUpperCase();
for (var j=0; j<i; j++) {
result += str[i].toLowerCase();
}
if (i < str.length-1) {
result += "-";
}
}
return result
}
accum("abCd");
function shortestWord(sentence) {
var words = sentence.split(" ");
var shortest = words[0].length;
for (var i=1; i<words.length; i++) {
if (words[i].length < shortest) {
shortest = words[i].length;
}
}
return shortest;
}
function longestWord(sentence) {
var words = sentence.split(" ");
var longest = 0;
var longestWord;
for (var i=0; i<words.length; i++) {
if (words[i].length > longest) {
longest = words[i].length;
longestWord = i;
}
}
return words[longestWord];
}
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.