JavaScript is the original and common name applied towards most flavors of a scripting language that originated on NetScape Navigator. Use this tag for questions regarding common implementations of ECMAScript, JavaScript, JScript, etc. JS does not typically refer to its ECMA-cousin, ActionScript.

learn more… | top users | synonyms (1)

2
votes
0answers
32 views

Alternative for eval() in javascript for expression evaluation

I'm looking at the alternative that can substitute the use of eval() and new Function() javascript techniques. I'm developing a solution build with javascript and the platform on which it is built (...
0
votes
0answers
29 views

coming from java to nodejs whats the convention for error handling logging? e.message or e.stack?

I come from java, when I got an expected error I printed stack traces. I'm coming now to work on nodejs (never really worked on javascript). and in the nodejs project which I need to maintain (...
0
votes
0answers
15 views

How to track unread messages for a user in a multi-channel chat application

I'm building an multi room chat application similar to gitter/slack as a side-project. The database schema i have so far is: user table (userid,username) chatRoom table (roomname etc) user-chatroom (...
-2
votes
0answers
28 views

Is it possible to know the names of functions that were called by a particular unit test in Javascript code coverage? [on hold]

I have a javascript project. I want to know the names of functions which were run by the unit tests. Is there a coverage tool that can provide this information? If no, how can I achieve this on my own?...
-2
votes
1answer
119 views

Why does an expression for a Javascript function that returns void still execute?

I'm so confused about how Void operator (in javascript) works and what is it's role. as i read, Void is an operator that evaluate an expression without returning a value, but by executing that script ...
1
vote
0answers
26 views

Find longest match from a set of possibles, given a string

I’m implementing glossary/dictionary in Javascript. It is populated with a set of terms and their definitions internally, then gets handed jQuery elements and searches the HTML, replacing any of the ...
-3
votes
0answers
81 views

Javascript: Comparing two identical object literals [migrated]

I'm pretty sure I figured this out before, but can't remember why this resolves to false. Can someone explain why? if ({foo: 'bar'} === {foo: 'bar'}) { console.log("Strictly Equal"); } else { ...
2
votes
1answer
135 views

Structuring a Game with Angular.JS

For a GameJam I'm trying to code a simple web-based text adventure game with sprites and small animations in AngularJS. I'm a little new to Angular and am having some trouble figuring out how to ...
0
votes
1answer
142 views

Business logic - Server side vs client side [duplicate]

In my current project, I have a screen which pulls data from several webservices, pulls data from database via backend API and checks that all resources have the same data or not. The other ...
-1
votes
0answers
27 views

Shuffling of MCQ's in my examination portal

the screen shots attached are structure of database of my exam portal, one picture represents the question bank and second represents the test details.Test ID is acting as a primary and foreign key. ...
-2
votes
0answers
23 views

Redis connection failing [migrated]

So I have node app docker containers running, and they run fine, but I noticed over the course of 1-2 months all of my apps begun having errors with redis, seems like the connection is not making it / ...
0
votes
0answers
37 views

JavaScript coding and project organizing conventions

Recently, I've started working with JavaScript projects closely and with my C# background I am already wondering about some conventions. I see a lot of source files that use dots to separate words (i....
0
votes
1answer
57 views

Manipulating DOM via script or rebuild website - which is better?

Let's assume you want to change what user sees on the website. There are two ways to do that: a) manipulate the DOM via JavaScript, but user has to download whole script, with possibility he may not ...
-1
votes
1answer
149 views

How does jQuery work?

What exactly happens underneath (I know it changes the paragraph tag's HTML when the circular div is clicked) when I run this piece of code? Could you please explain the callback function as well. &...
-2
votes
0answers
41 views

Is it possible get JS function? [closed]

I think that when JS developer had create JavaScript, they have create some function like log(), write(), alert(). They had do something like function alert() {} and then standard it (I imagine). So, ...
2
votes
0answers
115 views

What is a good way for a child to learn programming? [closed]

I learned to programme in Basic in the 80s, aged 7, on a BBC microcomputer. That computer was a good environment in which to learn - it was made with the specific intention of making programming easy....
-1
votes
0answers
54 views

Writing efficient JS for website [on hold]

Just a question really about best practice and to get a better insight in how to code in a more efficient manner. Currently when working on a website I'll have my custom.js file that usually looks ...
2
votes
1answer
104 views

Are promises functional

Functional programming is often explained to agree with lazy evaluation. As far as I know lazy evaluation means that a method gets called if the evaluator/browser/etc. thinks that is the next best ...
0
votes
0answers
55 views

Pointers on porting a c++ workflow domain specific language to javascript

I am writing a game in c++ with the v8 javascript engine embedded in it. I have a c++ workflow system I use to tell things how to do specific things. It's nice and I like it, but I need it to work ...
1
vote
1answer
155 views

Put code on client (JS) or server (C#)

In an ASP.NET app, I've got to decide whether to put a complex piece of code on either the client in JS or on the server in C#. I've considered performance (if on server, it would be a small ...
1
vote
0answers
38 views

Concept: Create rotating 3D Card

I have images of the two sides of a postcard, front and back. I'd like to create a little image view tool that creates a 3D postcard using the front/back images and have the user be able to rotate the ...
-3
votes
0answers
88 views

How to build a pixel grid like the one use in the million dollar billboard project? [closed]

I want to build a pixel grid system, that I can control the size of each block they way I want it. Also the user will be able to upload his image, link and title to each block/ blocks he chooses ( I ...
0
votes
1answer
161 views

Recently moved from java to javascript on nodejs, how to maintain code? Help!

I recently moved from java to javascript on nodejs. I was very excited, opened up my intellji IDE for an existing nodejs project only to find I cannot know what the parameters I see functions ...
0
votes
0answers
23 views

Do you inject everything explicitly used in a module even if it is loaded in a “parent” module?

When you build a app modularized what do you inject into submodules? Only those things that are used there but not added at the top level, or do you inject everything that is explicitly used in that ...
0
votes
0answers
49 views

Converting dynamic webpage into static

I am working on a project in which I need to take a dynamic website like adobe spark - https://spark.adobe.com/gallery/gallery-editors-choice/example/maggie-to-monte/ and create a static html+css page ...
0
votes
0answers
30 views

Why doesn't Object.prototype.toString produce more meaningful output?

Why doesn't Object.prototype.toString return a string representation of an object? I don't see any use for the current output and it seems that it would be more useful for the toString function to be ...
-1
votes
0answers
35 views

Service in Angular not successfully returning variables [closed]

I wrote a service to perform the $http.get calls and return the necessary variables that I needed for the functionality of my template. The issue I'm having is even though I'm able to see and log the ...
-1
votes
0answers
64 views

Is there any function to convert value to number format in JavaScript? [migrated]

Is there function to convert a value to number format in JavaScript? Ex: 10006.1056 to 10,006.16
0
votes
0answers
43 views

What is the better way to call the bind function in this case?

I am using es6 and babel. I have a class which serves as a in-memory data cache (DataStore). It has an API function called findByIndex. I can retrieve data by using an index name and related ...
0
votes
0answers
23 views

search library for internationalization

I use jquery and I would like to know if it is possible to put a tag in an html file and the text in this tag will take the value from a file? like <li id="report" role="presentation" data-toggle=...
-3
votes
1answer
87 views

How to incoporate jQuery UI into ASP.NET MVC 5 project that is on an offline system? [closed]

I am having some issues trying to incorporate jQuery UI into my project. I cannot use Nuget or anything else that goes to the internet, so I have downloaded the development package from the jQuery UI ...
1
vote
1answer
78 views

The advantages of a static blog generator with dynamic content

This is a design question. I am building a mathematically oriented blog, where I can discuss various areas of statistics. Now with math comes the importance of visualization--in particular interactive ...
0
votes
0answers
26 views

validating arguments in javascript constructors

In many cases, it is useful to have a constructor or factory method that validates arguments before instantiating an object, returning a new object if the arguments are valid and null otherwise. But ...
1
vote
1answer
54 views

Using expressions instead of statements

In javascript you can't use statements in expressions. Because of this you are forced to use logic and ternary operators in an expression when you want to use if or switch etc.. Since I didn't want to ...
3
votes
1answer
114 views

Would a site like stack overflow be better as separate static builds or a single app with run-time switches for each community?

I'm designing a web application. I'd like to use sub-domains to split the site into logic separate sections based on some category - exactly like the stack exchange websites do. I'm currently aware of ...
2
votes
1answer
92 views

Programatically determine that some functions are pure

I saw this question that shows it is impossible to programatically determine if a javascript function is pure, but is it sometimes possible to affirm that a function is pure - so something like... ...
-1
votes
0answers
41 views

how do I replace a variable in a template string in Javascript? [migrated]

Here's what I'm trying to achieve. let something = 'first string'; let template = `asdf=${something}asdf`; some.method(template) .then(function() { let something = 'new string'; ...
1
vote
0answers
63 views

How do I write an API that makes use of many smaller APIs?

I have a solid set of classes that do the following build tables from data and templates advanced form serialization build forms from data and templates launch overlays with forms/wizards short poll ...
1
vote
1answer
75 views

How to display recent post on website and make own search engine ? With PHP

On OLX like Website , Anytime a user posts a new ad. It comes in top of the page. No search is involved in it. Which technology we can use to make such functions. Suppose X is visiting my website ...
0
votes
1answer
84 views

Developing a simple HTML exercises with JavaScript [closed]

I'm developing a website with some simple HTML exercises (like the ones in Codeschool and Codacademy), and now I'm stuck at the correction phase, how can I compare two HTML strings and decide if the ...
1
vote
2answers
77 views

Difference in function expression

Recently I have come across with another way of writing a function expression, like this: setTimeout(() =>{/*code*/},1000); as opposed to: setTimeout(function(){/*code*/},1000); What is the ...
5
votes
3answers
155 views

Do Javascript minifiers optimize for gzip?

Case1: There are two snippets of code that are very similar and very gzip-able, one at the start of the document and the other is beyond 32kb at the end of the document. Does the minifier bring the ...
0
votes
2answers
113 views

What are some good approaches for reading Javscript code?

I'm looking for suggestions on how to read large Javascript codebases, for example, of a framework. For example, let's say P5js, but this applies to any large framework (i.e like AngularJS, Ember, etc)...
-2
votes
0answers
34 views

Advice for a Javascript table library [closed]

I wrote a javascript program a few years ago that displays a large data table. I am currently using a thin wrapper around the basic html tag. This was never ideal, but it was easy to implement. As ...
9
votes
2answers
310 views

What does it mean to inject data (vs behaviour) in a class constructor, and why is that considered bad practice?

I am reading the book "Learning TypeScript" by Remo Jansen. In one section the author describes how to create a very simple proof-of-concept MVC framework including how to create the Model class and ...
0
votes
1answer
74 views

Supporting multiple javascript frameworks in eventual single application

We are building several applications that will eventually be one front-end application. It is split up into several projects at the moment where each project is managed by its own scrum team. The ...
0
votes
0answers
52 views

Designing a DOM dependent library

Suppose for fun and learning purpose I need to write a library for forms then, how should I start? to be more descriptive let me summarize my doubts: For beginning I want to restrict myself to just ...
0
votes
0answers
37 views

Client REST UI on top of node based REST Service with OAUTH2 and role managment

I have a REST service with oauth2 authentication and a role based access control on top of my API. For an example, users can be account owners and may be able to get and post to /account/123/users. ...