Skip to main content

Javascript Arrays (What to learn


https://www.w3schools.com/js/js_arrays.asp

Structure of Arrays
Iteration on arrays

Array methods : https://www.w3schools.com/js/js_array_methods.asp

concat vs join
push
splice/shift/pop
sorting: https://www.w3schools.com/js/js_array_sort.asp
shuffling

Following is generic shuffling algorithm in java-script for all arrays

function shuffle(array) {
  var currentIndex = array.length, temporaryValue, randomIndex;

  // While there remain elements to shuffle...
  while (0 !== currentIndex) {

    // Pick a remaining element...
    randomIndex = Math.floor(Math.random() * currentIndex);
    currentIndex -= 1;

    // And swap it with the current element.
    temporaryValue = array[currentIndex];
    array[currentIndex] = array[randomIndex];
    array[randomIndex] = temporaryValue;
  }

  return array;
}

Comments

Popular posts from this blog

Guide for qualifying for a software engineering job for beginners

Note: This article is being updated. Every modification/addition is mentioned as edit number, for example first addition is titled as "edit v1". It is to guide the learners who have already read it. Please explore the links given in maroon fonts. Not only a candidate needs job, but companies are equally needy for employees. Being fresh (no professional experience) is not an abuse. Its quite acceptable for lot of jobs. However a fresh candidate must be aware of following things Every company needs three main things in a software engineer 1. Interest and dedication 2. Skills and capability 3. Knowledge and experience Most of the cases companies do not expect experts for their work, but they only seek dedication and capability, but yes for some jobs knowledge and experience of related domain is mandatory requirement but this case is not with most of the jobs Primary thing is you must explain/defend what you have tried "Done does not necessarily mean a su...

Why join DigitalNet

Along with formal benefits (competitive salary and incentives) like other stable and established organizations we offer a Promised friendly working environment What we do: Rather than remaking of formal small commericail applications, we offer solutions to complex problems of our clients, and we are open almost for any challenge convered in software development domain We have in progress future oriented applications which are purely research based for making  real contribution to society Research based domain: With highly specified scope we use/extend off-the-shelf libraries and write algorithms for Natural language processing Commercial domain : Small business applications, Adding/Modifying challenging features of existing applications of our clients Currently focusing Django/Angular  (please click  this link  explore more about Django)