ive Home cooks in Thiruvananthapuram are championing artificial additive-free jams, preserves, juice, ethnic eats and more By www.thehindu.com Published On :: Wed, 16 Oct 2024 13:42:08 +0530 Four home cooks in Thiruvananthapuram are turning fruits into value-added products without using artificial flavours or preservatives Full Article Features
ive Collective memory as currency [electronic resource] : the dominance of the past in the present / Tracy Adams. By darius.uleth.ca Published On :: Berlin ; Boston : De Gruyter [2024] Full Article
ive Plastic is fantastic: Credit cards register highest growth in five years By www.thehindu.com Published On :: Thu, 02 Jun 2016 07:52:10 +0530 Axis Bank leads charge, SBI narrows gap with ICICI, HDFC Bank on top; numbers inch up to 25m Full Article Mumbai Capital
ive India among top five innovation destinations: report By www.thehindu.com Published On :: Fri, 03 Jun 2016 00:00:00 +0530 Full Article Mumbai Capital
ive Sensex jumps 430 points in early trade on positive global trends By www.thehindu.com Published On :: Mon, 14 Oct 2024 10:41:09 +0530 The NSE Nifty climbed 138.80 points. Full Article Markets
ive Markets give up initial gains dragged by sharp fall in Kotak Bank, unabated foreign fund outflows By www.thehindu.com Published On :: Mon, 21 Oct 2024 10:35:51 +0530 Equity markets open strong but later decline; HDFC Bank gains, Kotak Mahindra Bank falls, global markets mixed Full Article Markets
ive Markets fall dragged by Hindustan Unilever; massive foreign fund outflows By www.thehindu.com Published On :: Thu, 24 Oct 2024 11:01:53 +0530 Nestle, Bharti Airtel, Bajaj Finserv, ICICI Bank and Maruti were the other big laggards Full Article Markets
ive New bridge to come up across Palar River at Sevilimedu By www.thehindu.com Published On :: Sun, 10 Nov 2024 00:53:06 +0530 Full Article Chennai
ive Three engineering students drown in Cauvery river in Namakkal By www.thehindu.com Published On :: Sun, 10 Nov 2024 16:01:40 +0530 Jedarpalayam police registered a case and are investigating Full Article Coimbatore
ive Police women under the ‘Police Akka’ initiative, to reach out to schoolgirls in Pudukottai district By www.thehindu.com Published On :: Sun, 10 Nov 2024 17:27:18 +0530 Policewomen nominated under this initiative will visit schools and colleges every 15 days to ascertain concerns and grievances of students and render assistance Full Article Tiruchirapalli
ive Five-day special educator training programme to start from November 11 By www.thehindu.com Published On :: Sun, 10 Nov 2024 20:04:06 +0530 The initiative is being organised by Chennai Volunteers, a social initiative of the Giving Matters Foundation, a not-for-profit organisation, in collaboration with the Portobello Institute, Ireland Full Article Tamil Nadu
ive Mediation should be given priority in family dispute cases: Chief Justice By www.thehindu.com Published On :: Sun, 10 Nov 2024 20:44:33 +0530 Full Article Tamil Nadu
ive Deputy Chief Minister launches initiatives to support start-up ecosystem in T.N. By www.thehindu.com Published On :: Tue, 12 Nov 2024 21:33:32 +0530 He also presents sanction letters for pre-incubation centres, which aim to support innovative business ideas in their initial stages Full Article Tamil Nadu
ive Organic/inorganic heterostructures templated by interfacial instability-driven BCP colloids in deformable emulsion droplets By pubs.rsc.org Published On :: Soft Matter, 2024, 20,8174-8180DOI: 10.1039/D4SM00921E, CommunicationYuqing Song, Nan Yan, Lingli Wan, Jingjing Li, Ye GaoCore–shell colloids are self-assembled in emulsion droplets driven by interfacial instability, which serve as excellent scaffolds for designing organic/inorganic heterostructures.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Effective patchiness from critical points of a coarse-grained protein model with explicit shape and charge anisotropy By pubs.rsc.org Published On :: Soft Matter, 2024, 20,8455-8467DOI: 10.1039/D4SM00867G, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Jens Weimar, Frank Hirschmann, Martin OettelCritical points of an anisotropic, coarse-grained protein model are used to detemine an “effective patchiness” by comparison to the Kern–Frenkel patchy model.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Segregative phase separation of strong polyelectrolyte complexes at high salt and high polymer concentrations By pubs.rsc.org Published On :: Soft Matter, 2024, 20,8505-8514DOI: 10.1039/D4SM00994K, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Conner H. Chee, Rotem Benharush, Lexi R. Knight, Jennifer E. LaaserComplexes of strong polyelectrolytes prepared well above the binodal are shown to undergo hydrophobicity-driven segregative phase separation.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Optimality and cooperativity in superselective surface binding by multivalent DNA nanostars By pubs.rsc.org Published On :: Soft Matter, 2024, 20,8515-8523DOI: 10.1039/D4SM00704B, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Christine Linne, Eva Heemskerk, Jos W. Zwanikken, Daniela J. Kraft, Liedewij LaanOur study shows that DNA nanostars with three binding sites (ligands) can (1) bind superselectively to surfaces based on receptor density, and (2) that interactions between ligands affect the optimum number of ligands required for superselectivity.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive pH and glucose dual-responsive phenylboronic acid hydrogels for smart insulin delivery By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM01004C, PaperKeke Yang, Hou Bo, Dewei Ma, Mingwei Peng, Qinglong Liu, Ziwen Heng, Zhongwei Gu, Xuhan Liu, Siyuan ChenPhenylboronic acid (PBA) is a widely exploited glucose-sensitive element for constructing glucose-responsive hydrogels to enable smart insulin delivery.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Jamming crossovers in a confined driven polymer in solution By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM00761A, PaperSetarehalsadat Changizrezaei, Mikko Karttunen, Colin DennistonA polymer confined in a nanochannel undergoes a crossover to a jammed state when pushed by a large spherical colloid. We examine the system using simulations that incorporate the full hydrodynamic driving and fluctuating forces.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Src kinase slows collective rotation of confined epithelial cell monolayers By pubs.rsc.org Published On :: Soft Matter, 2024, Accepted ManuscriptDOI: 10.1039/D4SM00827H, PaperNastassia Pricoupenko, Flavia Marsigliesi, Philippe Marcq, Carles Blanch-Mercader, Isabelle A BonnetCollective cell migration is key during development, wound healing and metastasis and relies on coordinated cell behaviors at the group level. Src kinase is a key signalling protein for physiological...The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Long-lived unidirectional flow of active particles within long narrow channels By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM00879K, PaperMan Xu, Ying Lan, Yuehua Yang, Hongyuan JiangWe present the dynamics of particles in a device divided into two chambers by V-shaped barriers and connected by a narrow channel. Here three distinct movement modes occur, including stochastic movement, oscillation and unidirectional flows.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Mapping deformation dynamics to composition of topologically-active DNA blends By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM01065E, PaperKarthik R. Peddireddy, Ryan McGorty, Rae M. Robertson-AndersonWe leverage in situ enzymatic topological conversion and OpTiDDM to map the deformation dynamics of DNA blends with over 70 fractions of linear, ring and supercoiled molecules that span the phase space of possible topological compositions.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Towards a universal model for the foaming behavior of surfactants: a case study on per- and polyfluoroalkyl substances (PFAS) By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM00931B, PaperMuchu Zhou, Reza FoudaziFoam fractionation offers a promising solution for the separation of surface-active contaminants from water.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Active nematic coherence probed under spatial patterns of distributed activity By pubs.rsc.org Published On :: Soft Matter, 2024, Accepted ManuscriptDOI: 10.1039/D4SM00651H, PaperIgnasi Vélez Cerón, Jordi Ignes-Mullol, Francesc SaguesA photoresponsive variant of the paradigmatic active nematic fluid made of microtubules and powered by kinesin motors is studied in the conventional two-dimensional interfaced form when forced under blue-light illumination....The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Banana DNA derivatives as homeotropic alignment layers in optical devices By pubs.rsc.org Published On :: Soft Matter, 2024, 20,8561-8569DOI: 10.1039/D4SM00322E, PaperRafał Węgłowski, Anna Spadło, Dorota WęgłowskaIn this study, DNA extracted from bananas was functionalized and used as a homeotropic alignment layer for liquid crystals.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Dynamical crossovers and correlations in a harmonic chain of active particles By pubs.rsc.org Published On :: Soft Matter, 2024, 20,8638-8653DOI: 10.1039/D4SM00350K, PaperSubhajit Paul, Abhishek Dhar, Debasish ChaudhuriWe explore the dynamics of a tracer in a harmonic chain of active particles, investigating the influence of interactions. Depending upon the time-scales governed by the interaction and the persistence of activity, we explore crossovers between different scaling behaviors of its dynamics.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Model predictive control of non-interacting active Brownian particles By pubs.rsc.org Published On :: Soft Matter, 2024, 20,8581-8588DOI: 10.1039/D4SM00902A, PaperTitus Quah, Kevin J. Modica, James B. Rawlings, Sho C. TakatoriModel predictive control is used to guide the spatiotemporal distribution of active Brownian particles by forecasting future states and optimizing control inputs to achieve tasks like dividing a population into two groups.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Tuning collective actuation of active solids by optimizing activity localization By pubs.rsc.org Published On :: Soft Matter, 2024, 20,8570-8580DOI: 10.1039/D4SM00868E, PaperDavi Lazzari, Olivier Dauchot, Carolina BritoActive solids, more specifically elastic lattices embedded with polar active units, exhibit collective actuation when the elasto-active feedback, generically present in such systems, exceeds some critical value.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Pickering emulsions for stimuli-responsive transdermal drug delivery: effect of rheology and microstructure on performance By pubs.rsc.org Published On :: Soft Matter, 2024, 20,8621-8637DOI: 10.1039/D4SM00993B, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Simona Migliozzi, Yiting He, Maryam Parhizkar, Yang Lan, Panagiota AngeliElucidating the impact of microgels attributes on the microstructure, rheology and functionality of Pickering emulsions.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Entropically and enthalpically driven self-assembly of a naphthalimide-based luminescent organic π-amphiphile in water By pubs.rsc.org Published On :: Soft Matter, 2024, 20,8684-8691DOI: 10.1039/D4SM00986J, PaperSk Mursed Ali, Sujauddin Sk, Shuvajyoti Sarkar, Sayani Das, Nayim Sepay, Mijanur Rahaman MollaEntropically and enthalpically favourable vesicular self-assembly of a naphthalimide based water soluble luminescent organic dipolar building block is reported.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Bending of polymer films: a method for obtaining a compressive modulus of thin films By pubs.rsc.org Published On :: Soft Matter, 2024, 20,8589-8600DOI: 10.1039/D4SM00084F, PaperAkihiro Ohara, Ko OkumuraWe constructed a theory and method for measuring the compressive modulus by combining tensile and bending tests. Elastic asymmetry was confirmed in an industrial PET film.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Light scattering study of algal floc growth and structure: alum vs. polymeric plant-derived flocculant By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM00837E, PaperTemitope Orimolade, Ngoc-Tram Le, Lyle Trimble, Bandaru Ramarao, Sitaraman KrishnanAlgal flocculation using alum shows dynamic fractal restructuring over time, while Moringa oleifera protein induces faster densification, enhancing floc strength.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Hydrogel-based 3D fabrication of multiple replicas with varying sizes and materials from a single template via iterative shrinking By pubs.rsc.org Published On :: Soft Matter, 2024, Accepted ManuscriptDOI: 10.1039/D4SM00835A, PaperEunseok Heo, Hye Been Koo, Jun Chang Yang, In Cho, Hyun-Hee Lee, Yong-Jin Yoon, Steve Park, Jae-Byum Chang3D printing technologies have been widely used for the rapid prototyping of 3D structures, but their application in a broader context has been hampered by their low printing throughput. For...The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Understanding Polymer-Colloid Gels: A Solvent Perspective Using Low-Field NMR By pubs.rsc.org Published On :: Soft Matter, 2024, Accepted ManuscriptDOI: 10.1039/D4SM01098A, CommunicationLéo Hervéou, Gauthier Legrand, Thibaut Divoux, Guilhem Pablo BaezaThe present work emphasizes the relevance of low-field NMR relaxometry to investigate colloid-polymer hydrogels by probing water dynamics across a wide range of formulations between 10°C and 80°C. By examining...The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Dynamics of switching processes: general results and applications to intermittent active motion By pubs.rsc.org Published On :: Soft Matter, 2024, Accepted ManuscriptDOI: 10.1039/D4SM01054J, Paper Open Access   This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.Ion Santra, Deepak Gupta, Kristian S OlsenSystems switching between different dynamical phases is an ubiquitous phenomenon. The general understanding of such a process is limited. To this end, we present a general expression that captures fluctuations...The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Reversible pH-responsive supramolecular aggregates from viologen based amphiphiles – A molecular design perspective By pubs.rsc.org Published On :: Soft Matter, 2024, Accepted ManuscriptDOI: 10.1039/D4SM00695J, PaperRedhills L. Narendran, Archita PatnaikpH responsive self-assembled supramolecular systems in water hold tremendous promise spanning across the various realms of science and technology. Herein, we report the design and synthesis of benzyl viologen (BV)...The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Obstacle-enhanced spontaneous oscillation of confined active granules By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM01027B, PaperXue Zhang, Yuxin Tian, Ran Ni, Yong Zhu, Luhui Ning, Peng Liu, Mingcheng Yang, Ning ZhengObstacle-enhanced spontaneous oscillation of confined active granules. (a) Without obstacles. (b) With obstacles.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Biomimetic mineralization of positively charged silica nanoparticles templated by thermoresponsive protein micelles: applications to electrostatic assembly of hierarchical and composite superstructures By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM00907J, PaperNada Y. Naser, William C. Wixson, Helen Larson, Brandi M. Cossairt, Lilo D. Pozzo, François BaneyxExploiting the ability of a solid-binding elastin-like peptide to micellize, we mineralize monodisperse silica nanoparticles whose positive surface charge enables one-step electrostatic assembly of various mono- and bi-material superstructures.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Individual Closed-Loop Control of Micromotors by Selective Light Actuation By pubs.rsc.org Published On :: Soft Matter, 2024, Accepted ManuscriptDOI: 10.1039/D4SM00810C, Communication Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.David Rivas, Max Sokolich, Sambeeta DasControl of individual micromotors within a group would allow for improved efficiency, greater ability to accomplish complex tasks, higher throughput, and increased adaptability. However, independent control of micromotors remains a...The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Coarsening dynamics of aster defects in a model polar active matter By pubs.rsc.org Published On :: Soft Matter, 2024, Accepted ManuscriptDOI: 10.1039/D4SM00788C, PaperSoumyadeep Mondal, Pankaj Popli, Sumantra SarkarWe numerically study the dynamics of topological defects in 2D polar active matter coupled to a conserved density field, which shows anomalous kinetics and defect distribution. The initial many- defect...The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Shape transformations in peptide-DNA coacervates driven by enzyme-catalyzed deacetylation By pubs.rsc.org Published On :: Soft Matter, 2024, Accepted ManuscriptDOI: 10.1039/D4SM01091D, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Merlijn van Haren, Nienke Helmers, Luuk Verploegen, Viveca Beckers, Evan SpruijtBiomolecular condensates formed by liquid-liquid phase separation (LLPS) are important organizers of biochemistry in living cells. Condensate formation can be dynamically regulated, for example by protein binding or enzymatic processes....The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Percolation transitions in a binary mixture of active Brownian particles with different softness By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM00981A, PaperMonika Sanoria, Raghunath Chelakkot, Amitabha NandiHomogeneous active Brownian particle (ABP) systems with purely repulsive interactions are considered to exhibit a simple phase behavior, but various physical attributes of active entities can lead to variation in the collective dynamics.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive The influence of active agent motility on SIRS epidemiological dynamics By pubs.rsc.org Published On :: Soft Matter, 2024, Advance ArticleDOI: 10.1039/D4SM00864B, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.R. Kailasham, Aditya S. KhairMotility induced phase separation of active disks with SIRS epidemiological dynamics.To cite this article before page numbers are assigned, use the DOI form of citation above.The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Effects of Hydration Water on Bioresponsiveness of Polymer Interfaces Revealed by Analysis of Linear and Cyclic Polymer–Grafted Substrates By pubs.rsc.org Published On :: Soft Matter, 2024, Accepted ManuscriptDOI: 10.1039/D4SM00977K, Paper Open Access   This article is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported Licence.Shin-nosuke Nishimura, Naoya Kurahashi, Shohei Shiomoto, Yoshihisa Harada, Masaru TanakaGiven that the hydration water of polymer matrices may differ from that of outermost polymer surfaces, processes at biomaterial–biofluid interfaces and role of hydration water therein cannot be adequately examined...The content of this RSS Feed (c) The Royal Society of Chemistry Full Article
ive Five Interesting Ways to Use Array.reduce() (And One Boring Way) By 24ways.org Published On :: Wed, 18 Dec 2019 12:00:00 +0000 Chris Ferdinandi turns the heat down low and lets the sauce reduce while we take a look at how to add spice to our source with a sprinkling of Array.reduce(). Just a little ingenuity with the humblest of functions. Of all the modern array methods, the one I had the hardest time wrapping my head around was Array.reduce(). On the surface, it seems like a simple, boring method that doesn’t do much. But below its humble exterior, Array.reduce() is actually a powerful, flexible addition to your developer toolkit. Today, we’re going to look at some cool things you can do with Array.reduce(). How Array.reduce() works Most of the modern array methods return a new array. The Array.reduce() method is a bit more flexible. It can return anything. Its purpose is to take an array and condense its content into a single value. That value can be a number, a string, or even an object or new array. That’s the part that’s always tripped me up – I didn’t realize just how flexible it is! The syntax The Array.reduce() accepts two arguments: a callback method to run against each item in the array, and a starting value. The callback also accepts two arguments: the accumulator, which is the current combined value, and the current item in the loop. Whatever you return is used as the accumulator for the next item in the loop. On the very first loop, that starting value is used instead. var myNewArray = [].reduce(function (accumulator, current) { return accumulator; }, starting); Let’s look at some examples to make this all tangible. 1. Adding numbers together Let’s say you had an array of numbers that you wanted to add together. Using Array.forEach(), you might do something like this: var total = 0; [1, 2, 3].forEach(function (num) { total += num; }); This is the cliche example for using Array.reduce(). I find the word accumulator confusing, so in this example, I’m calling it sum, because that’s what it is. var total = [1, 2, 3].reduce(function (sum, current) { return sum + current; }, 0); Here, we pass in 0 as our starting value. In the callback, we add the current value to the sum, which has our starting value of 0 on the first loop, then 1 (the starting value of 0 plus the item value of 1), then 3 (the sum value of 1 plus the item value of 2), and so on. Here’s a demo. 2. Combining multiple array methods into Array.map() and Array.filter() into a single step Imagine you had an array of wizards at Hogwarts. var wizards = [ { name: 'Harry Potter', house: 'Gryfindor' }, { name: 'Cedric Diggory', house: 'Hufflepuff' }, { name: 'Tonks', house: 'Hufflepuff' }, { name: 'Ronald Weasley', house: 'Gryfindor' }, { name: 'Hermione Granger', house: 'Gryfindor' } ]; You want to create a new array that contains just the names of wizards who are in Hufflepuff. One way you could do that is by using the Array.filter() method to get back just wizards whose house property is Hufflepuff. Then, you’d use the Array.map() method to create a new array containing just the name property for the remaining wizards. // Get the names of the wizards in Hufflepuff var hufflepuff = wizards.filter(function (wizard) { return wizard.house === 'Hufflepuff'; }).map(function (wizard) { return wizard.name; }); With the Array.reduce() method, we can get the same array in a single pass, improving our performance. You pass in an empty array ([]) as the starting value. On each pass, you check to see if the wizard.house is Hufflepuff. If it is, you push it to the newArr (our accumulator in this example). If not, you do nothing. Either way, you return the newArr to become the accumulator on the next pass. // Get the names of the wizards in Hufflepuff var hufflepuff = wizards.reduce(function (newArr, wizard) { if (wizard.house === 'Hufflepuff') { newArr.push(wizard.name); } return newArr; }, []); Here’s another demo. 3. Creating markup from an array What if, instead of creating an array of names, we wanted to create an unordered list of wizards in Hufflepuff? Instead of passing an empty array into Array.reduce() as our starting value, we’ll pass in an empty string ('') and call it html. If the wizard.house equals Hufflepuff, we’ll concatenate our html string with the wizard.name wrapped in an opening and closing list item (li). Then, we’ll return the html to become the accumulator on the next loop. // Create a list of wizards in Hufflepuff var hufflepuffList = wizards.reduce(function (html, wizard) { if (wizard.house === 'Hufflepuff') { html += '<li>' + wizard.name + '</li>'; } return html; }, ''); Add an opening and closing unordered list element before and after Array.reduce(), and you’re ready to inject your markup string into the DOM. // Create a list of wizards in Hufflepuff var hufflepuffList = '<ul>' + wizards.reduce(function (html, wizard) { if (wizard.house === 'Hufflepuff') { html += '<li>' + wizard.name + '</li>'; } return html; }, '') + '</ul>'; See it in action here. 4. Grouping similar items in an array together The lodash library has a groupBy() method takes a collection of items as an array and groups them together into an object based on some criteria. Let’s say you want an array of numbers. If you wanted to group all of the items in numbers together based on their integer value, you would do this with lodash. var numbers = [6.1, 4.2, 6.3]; // returns {'4': [4.2], '6': [6.1, 6.3]} _.groupBy(numbers, Math.floor); If you had an array of words, and you wanted to group the items in words by their length, you would do this. var words = ['one', 'two', 'three']; // returns {'3': ['one', 'two'], '5': ['three']} _.groupBy(words, 'length'); Creating a groupBy() function with Array.reduce() You can recreate that same functionality using the Array.reduce() method. We’ll create a helper function, groupBy(), that accepts the array and criteria to sort by as arguments. Inside groupBy(), we’ll run Array.reduce() on our array, passing in an empty object ({}) as our starting point, and return the result. var groupBy = function (arr, criteria) { return arr.reduce(function (obj, item) { // Some code will go here... }, {}); }; Inside the Array.reduce() callback function, we’ll check to see if the criteria is a function, or a property of the item. Then we’ll get its value from the current item. If there’s no property in the obj with that value yet, we’ll create it and assign an empty array as its value. Finally, we’ll push the item to that key, and return the object as the accumulator for the next loop. var groupBy = function (arr, criteria) { return arr.reduce(function (obj, item) { // Check if the criteria is a function to run on the item or a property of it var key = typeof criteria === 'function' ? criteria(item) : item[criteria]; // If the key doesn't exist yet, create it if (!obj.hasOwnProperty(key)) { obj[key] = []; } // Push the value to the object obj[key].push(item); // Return the object to the next item in the loop return obj; }, {}); }; Here’s a demo of the completed helper function. Special thanks to Tom Bremer for helping me make some improvements to this one. You can find this helper function and more like it on the Vanilla JS Toolkit. 5. Combining data from two sources into an array Remember our array of wizards? var wizards = [ { name: 'Harry Potter', house: 'Gryfindor' }, { name: 'Cedric Diggory', house: 'Hufflepuff' }, { name: 'Tonks', house: 'Hufflepuff' }, { name: 'Ronald Weasley', house: 'Gryfindor' }, { name: 'Hermione Granger', house: 'Gryfindor' } ]; What if you had another data set, an object of house points each wizard has earned. var points = { HarryPotter: 500, CedricDiggory: 750, RonaldWeasley: 100, HermioneGranger: 1270 }; Imagine you wanted to combine both sets of data into a single array, with the number of points added to each wizard’s data in the wizards array. How would you do it? The Array.reduce() method is perfect for this! var wizardsWithPoints = wizards.reduce(function (arr, wizard) { // Get the key for the points object by removing spaces from the wizard's name var key = wizard.name.replace(' ', ''); // If the wizard has points, add them // Otherwise, set them to 0 if (points[key]) { wizard.points = points[key]; } else { wizard.points = 0; } // Push the wizard object to the new array arr.push(wizard); // Return the array return arr; }, []); Here’s a demo combining data from two sources into an array. 6. Combining data from two sources into an object What if you instead wanted to combine the two data sources into an object, where each wizard’s name was the key, and their house and points were properties? Again, the Array.reduce() method is perfect for this. var wizardsAsAnObject = wizards.reduce(function (obj, wizard) { // Get the key for the points object by removing spaces from the wizard's name var key = wizard.name.replace(' ', ''); // If the wizard has points, add them // Otherwise, set them to 0 if (points[key]) { wizard.points = points[key]; } else { wizard.points = 0; } // Remove the name property delete wizard.name; // Add wizard data to the new object obj[key] = wizard; // Return the array return obj; }, {}); Here’s a demo combining two data sets into an object. Should you use Array.reduce() more? The Array.reduce() method has gone from being something I thought was pointless to my favorite JavaScript method. So, should you use it? And when? The Array.reduce() method has fantastic browser support. It works in all modern browsers, and IE9 and above. It’s been supported in mobile browsers for a long time, too. If you need to go back even further than that, you can add a polyfill to push support back to IE6. The biggest complaint you can make about Array.reduce() is that it’s confusing for people who have never encountered it before. Combining Array.filter() with Array.map() is slower to run and involves extra steps, but it’s easier to read. It’s obvious from the names of the methods what they’re supposed to be doing. That said, there are times where Array.reduce() makes things that would be complicated more simple rather than more complicated. The groupBy() helper function is a good example. Ultimately, this is another tool to add to your toolkit. A tool that, if used right, can give you super powers. About the author Chris Ferdinandi helps people learn vanilla JavaScript. He believes there’s a simpler, more resilient way to make things for the web. Chris is the author of the Vanilla JS Pocket Guide series, creator of the Vanilla JS Academy training program, and host of the Vanilla JS Podcast. His developer tips newsletter is read by thousands of developers each weekday. He’s taught developers at organizations like Chobani and the Boston Globe, and his JavaScript plugins have been used used by Apple and Harvard Business School. Chris Coyier, the founder of CSS-Tricks and CodePen, has described his writing as “infinitely quote-worthy.” Chris loves pirates, puppies, and Pixar movies, and lives near horse farms in rural Massachusetts. He runs Go Make Things with Bailey Puppy, a lab-mix from Tennessee. More articles by Chris Full Article Code javascript
ive Celebspotting: Lakme Fashion Week Winter/Festive 2016 By www.thehindu.com Published On :: Mon, 29 Aug 2016 16:02:46 +0530 Who modelled for whom during this year's edition of Lakme Fashion Week's Winter collection? Full Article Fashion
ive Bending fashion the cheapensive way By www.thehindu.com Published On :: Tue, 06 Sep 2016 15:45:41 +0530 Creating a balance between budget and fashion, branded and streetwear, reuse and recycle, Bengaluru's college goers show the way Full Article Metroplus
ive Onam weaves for 2022 comes alive with blooms and Kerala-themed motifs By www.thehindu.com Published On :: Sat, 03 Sep 2022 11:43:32 +0530 Designers dress up the traditional cream-and-gold Kerala cotton with hand-painted motifs, embroidery, cut work and more Full Article Fashion
ive For the festive season, designers are working with artisans to create clothes with a conscience By www.thehindu.com Published On :: Thu, 20 Oct 2022 17:57:52 +0530 As gifting and dressing up for the festive season begins, consumers are increasingly looking at sustainable, environment friendly choices Full Article Life & Style
ive Has the Congress already given up? By www.thehindubusinessline.com Published On :: Mon, 03 Feb 2014 16:42:22 +0530 Full Article Stanly Johny