Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
JavaScript is a versatile, high-level programming language. It is the programming language in all browsers.and can be used for back-end programming with node.js. Use this tag for questions regarding vanilla JavaScript; optionally tagged with an ECMAScript version. If you are using a preprocessor such as TypeScript please tag with that too.
5
votes
1
answer
123
views
Developer-tool: Creates large arrays with random-strings for testing-purposes
I've made this developer-tool for my own use. Perhaps for colleagues too.
Currently I'm thinking about enhancing it. So that different data-types could be chosen.
But before that I like it to be re …
1
vote
1
answer
45
views
Attach / detach navigation bar depending on scrolled position of the document
The idea is the following:
I have a large text with a header upon it and a navigation bar. The navigation bar is located between header and text.
If the user scrolls downwards then the header-part m …
2
votes
2
answers
9k
views
array_diff in JavaScript
I have tried the implement my own version in JavaScript. …
1
vote
1
answer
689
views
JavaScript-function for to convert a dash-separated string into camel case
I have to write a function which turns a string with the words separated by dashes ( - ) into a sentence using camel case notation.
I've had the following idea for an implemenation using the reduce- …
9
votes
2
answers
1k
views
A function which translates a sentence to title-case
The task is to write a JavaScript-function which translates a given blank-separated sentence to title-case. …
0
votes
1
answer
71
views
JavaScript function for logging the members of an object (with horizontal alignment)
When iterating over the members of an object for logging the keys / values one gets a "stair case" effect.
Therefore I wrote myself this function which takes care for a left-alignment of the values.
…
0
votes
1
answer
41
views
Data-structure "Singly-Listed List" in JavaScript
The purpose of the data-structure is to manage person-objects.
Persons can be added at any time. But the order can't be changed afterward.
Only the deletion of a person is possible. Represents the …
3
votes
4
answers
18k
views
Getting the index of a character within the alphabet
I've made this function to map alphabetic coordinates to their corresponding ordinal number.
var exec = document.querySelector('#exec');
// Maps alphabetic characters to their index
// wi …
1
vote
1
answer
62
views
Showing the current view-position within the web page
I've made this coding for large web pages with lots of text, images etc. If the user scrolls down or up it shows where the current view approximately is. In relation to the overall document height.
I …
1
vote
1
answer
4k
views
Calculate sum of digits from a given number using String's slice method
This is the "classic" algorithm for calculating the sum of digits uses the modulo-operator together with the division-operator. I had the idea of using the slice-method with a negative index for accom …
1
vote
3
answers
378
views
Calculate the value of an arithmetic term written in Polish Notation
I have to create a program which calculates the result of an arithmetic term written in Polish Notation.
var parseNotation = parseNotation || {};
/**
* Computes the result of an given arithmeti …
3
votes
5
answers
997
views
JavaScript function to create a duplicate-free copy of an array
I've made this function which returns a copy of a given array with no duplicated elements in it.
/**
* Returns an array with only unique elements. Based
* upon an array which might possibly c …
5
votes
2
answers
3k
views
Basic arithmetic calculator in JavaScript
Task is basically:
"Write a function which takes two number as the first two parameter. The third parameter is one of the arithmetic operators (+ , - , * , /). Execute the arithmetic operation (numbe …
4
votes
1
answer
99
views
JavaScript constructor function "RandomNumbers"
My idea is to have objects which contain random numbers. The random numbers are keeped in some data structure (within the objects). Furthermore the objects shall have methods for working with the rand …
3
votes
2
answers
11k
views
Tooltip-overlay following the mouse pointer
Afterwards the JavaScript function can be used.
Should I try to concentrate more on JavaScript only? I mean: Should I try to reduce the mandatory HTML-, CSS-code to a minimun? … The parameter of the JavaScript-function are optional.
But actually the first parameter (CSS-selector) is mandatory for the function to work. If it isn't correct to code will silently fail. …