Skip to content

Author: admin@master

Codility – CountDiv JavaScript solution

I’m still a bit new to JavaScript so if anyone care to explain how to solve this small issue. Basically, i’m using different languages to solve codility training tasks. I’ve encountered small problem when working with java script, floating points. Here is the example of what I mean. Task in …

Why does a named IIFE result in a ReferenceError outiside of it?

Why did I get “ReferenceError: Person is not defined” for the following code? Since function Person is run, it is first created. However, I cannot explain why it is not then recognized. My only thought is that IIFE ignores the name they are given. Answer You get the error because the name of a function create…

Validation for textbox by using checkbox

This is my code: This is my angularjs Code: In the above code when I click the Continue button, first check the checkbox checked or not after it will check enter the password or not. Answer Check Once Is it what you want or something else Remove alerts ands code what you want

How to get name of datatable column?

I’m using DataTable 1.10.9 (from https://datatables.net). Columns for the datatable are defined at the initialization step in javascript and each column has a unique name, e.g.: I know I can get the column from the table by the name I’ve given it, but I can’t seem to find how to find a colum…

replace newline string literal – ‘n’ in javascript

I have string literal, n in a variable. I am trying to replace it with empty string. But it doesn’t work. value evaluates to the string literal – n. I expect no output from console.log. But it prints Empty line followed by a backward slash (for some reason, stack overflow has trimmed the empty lin…

Javascript Pangram Regex

I am trying to write a REGEX to test for a PANGRAM. I can do it the traditional way, but cannot seem to solve it for more than 90% of my tests with a regular expression. Input: string Output: true || false Test Results so far. 6/10 /([a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, s]+)/i 6/10 /[a-z]{1}/…